- Jul 04, 2023
-
-
Igor Munkin authored
* test: fix flaky <unit-jit-parse.test.lua> * Fix use-def analysis for vararg functions. * Fix use-def analysis for BC_VARG. * Fix TNEW load forwarding with instable types. * Fix memory probing allocator to check for valid end address, too. * Another fix for lua_yield() from C hook. * Fix lua_yield() from C hook. * Fix saved bytecode encapsulated in ELF objects. * x64: Fix 64 bit shift code generation. * Fix canonicalization of +-0.0 keys for IR_NEWREF. * test: add utility for parsing `jit.dump` * test: split utils.lua into several modules * test: rewrite lj-49-bad-lightuserdata test in C * test: rewrite misclib-sysprof-capi test in C * test: rewrite misclib-getmetrics-capi test in C * test: introduce utils.h helper for C tests * test: introduce module for C tests * test: fix setting of {DY}LD_LIBRARY_PATH variables * build: fix build with LUAJIT_USE_GDBJIT enabled * ci: update the branch name for Tarantool 2.11 Closes #8718 Part of #7900 Part of #8516 NO_DOC=LuaJIT submodule bump NO_TEST=LuaJIT submodule bump
-
Sergey Bronnikov authored
Previous attempt to fix flakiness in commit 6a2c73f8 ("test: fix flakiness in gh_6128_background_mode_test") used a constant buffer size in check_err_msg function. Tarantool 2.10 has a bit bigger log before a desired message that other versions of Tarantool and it leads to a this resulted in a truncated message ("entering the even" instead of "entering the event loop"). Patch replaces check_err_msg() implementation to grep_log used in luatest, it reads the whole log. Also patch renames check_err_msg to check_msg, because "entering the event loop" is not an error message. Follows up #6128 NO_CHANGELOG=fix test NO_DOC=fix test (cherry picked from commit 1c8e7124)
-
Magomed Kostoev authored
Function execution permissions should only be checked on constraint creation. So when the function is used to check a tuple access rights don't have to be checked on each call for the current user. Closes #7873 NO_DOC=bugfix (cherry picked from commit 6b8f2c5f)
-
Magomed Kostoev authored
Function execution permissions should only be checked on functional index creation and on functional index function set. So when the function is used by key_list_iterator its rights don't have to be checked on each call for the current user. Part of #7873 NO_DOC=bugfix NO_CHANGELOG=see the next commit (cherry picked from commit ddbdb77a)
-
Georgiy Lebedev authored
When a space is altered, we abort all in-progress transactions and delete all stories related to that space: the problem is we don't delete the stories' read gaps, which are also linked to the stories' transactions, which get cleaned up on transaction destruction — this, in turn, results in heap-use-after-free. To fix this, clean up stories' read gap in `memtx_on_space_delete` — we don't do this in `memtx_tx_story_delete` since it expects the story to not have any read gaps (see `memtx_tx_story_gc_step`). Tested this patch manually against Nick Shirokovskiy's experimental small-ASAN integration branch. Closes #8781 NO_DOC=bugfix NO_TEST=<already covered by existing tests, but was not detectable by ASAN> (cherry picked from commit e1ed31bb)
-
- Jun 30, 2023
-
-
Sergey Bronnikov authored
Test runs an external process with tarantool that writes to a log file. Then test reads that log file and searches a string with required message in it (see function check_err_msg). Test was flaky on macOS and I suspect it was happening due to a high log level - timeout was not enough to wait message in the log file. Patch decreases a log level to a default value and replaces io functions with the similar alternatives in a fio module. Using fio functions allows to not block fibers. NO_CHANGELOG=test fix NO_DOC=test fix (cherry picked from commit 47380bb7)
-
Vladimir Davydov authored
The xlog reader Lua module uses the xlog_cursor_next_row, which decodes the row header with xrow_header_decode. The latter silently ignores any unknown fields, which complicates catching bugs when garbage is written to a row header by mistake, for example, see #8783. Let's parse a row header without using xrow_header_decode in the xlog reader module, like we parse a row body, and output all unknown/invalid keys as is. To do that, we have to extend the xlog cursor API with the new method xlog_cursor_next_row_raw that returns a pointer to the position in the tx buffer where the next xrow is stored without advancing it. To avoid a memory leak in case the caller fails to parse an xrow returned by this function, we also have to move the call to xlog_tx_cursor_destroy from xlog_tx_cursor_next_row to xlog_cursor_next_tx. While we are at it, - Don't raise an error if a key type encountered in a row body is invalid (not an integer). Instead, silently ignore such keys. - Remove the useless body MsgPack validness check because we already check it after decoding the header. - Add error injection based tests to check all the corner cases. NO_DOC=bug fix (cherry picked from commit 8a25d170)
-
Vladimir Davydov authored
To avoid garbage written to xlog. Closes #8783 NO_DOC=bug fix NO_TEST=next commit (cherry picked from commit f058cee7)
-
- Jun 29, 2023
-
-
Ilya Verbin authored
Apple's libunwind for AArch64 returns the Instruction Pointer with the Pointer Authentication Codes (bits 47-63) even though Tarantool is compiled for arm64 (not arm64e) architecture, so we have to strip them out [1]. Although there is the ptrauth_strip macro for this purpose, it works only if compilation target is arm64e (not arm64) [2]. 1. https://developer.apple.com/documentation/security/preparing_your_app_to_work_with_pointer_authentication#3042105 2. https://github.com/dotnet/runtime/issues/42955#issuecomment-886910180 Closes #8074 Closes tarantool/tarantool-qa#308 Closes tarantool/tarantool-qa#309 NO_DOC=bugfix (cherry picked from commit 88990e2f)
-
- Jun 27, 2023
-
-
Igor Munkin authored
<luaT_pushtuple> function created a new GCfunc object for a tuple __gc handler (i.e. <lbox_tuple_gc>), having no upvalues, on each call when tuple object for Lua world is created. The change introduces the reference to the single GCfunc object created on Tarantool startup and stored to Lua registry. Using this approach in scope of <luaT_pushtuple> is aimed to reduce Lua GC memory usage. Part of #5201 NO_DOC=refactoring NO_TEST=refactoring NO_CHANGELOG=refactoring Reviewed-by:
Vladimir Davydov <vdavydov@tarantool.org> Reviewed-by:
Sergey Kaplun <skaplun@tarantool.org> Signed-off-by:
Igor Munkin <imun@tarantool.org> (cherry picked from commit 8d7d1460)
-
- Jun 23, 2023
-
-
Georgiy Lebedev authored
Space index build and space format checking operations don't destroy space iterator on `txn_check_singlestatement` failure — fix this. Closes #8773 NO_DOC=bugfix NO_TEST=<leak happens in small, cannot be detected by sanitizer> (cherry picked from commit 6689f511)
-
Georgiy Lebedev authored
The procedure name cache uses a region for hash table entry allocation, but the cache is a thread local variable, while the `region` uses a `slab` allocator the lifetime of which is bounded by `main`, while thread locals are destroyed after `main`: use the `malloc` allocator instead. Benchmark from #7207 shows that this change does not effect performance. Closes #8777 NO_CHANGELOG=<leak does not affect users> NO_DOC=bugfix NO_TEST=<detected by ASAN> (cherry picked from commit 7135910e)
-
- Jun 22, 2023
-
-
Sergey Bronnikov authored
Before a commit ec1af129 ("box: do not close xlog file descriptors in the atfork handler") there was a bug when Tarantool with enabled background mode via environment variable could lead a crash: NO_WRAP ``` $ TT_PID_FILE=tarantool.pid TT_LOG=tarantool.log TT_BACKGROUND=true TT_LISTEN=3301 tarantool -e 'box.cfg{}' $ tail -3 tarantool.log 2021-11-02 16:05:43.672 [2341202] main init.c:696 E> LuajitError: cannot read stdin: Resource temporarily unavailable 2021-11-02 16:05:43.672 [2341202] main F> fatal error, exiting the event loop 2021-11-02 16:05:43.672 [2341202] main F> fatal error, exiting the event loop ``` NO_WRAP With commit ec1af129 ("box: do not close xlog file descriptors in the atfork handler") described bug could not be reproduced. Proposed patch adds a test that starts Tarantool in background mode enabled via box.cfg option and via environment variable TT_BACKGROUND to make sure this behaviour will not be broken in a future. Closes #6128 NO_DOC=test (cherry picked from commit f676fb7c)
-
Ilya Verbin authored
There are sporadic segfaults in libunwind during backtrace_collect(). Reproducible with the latest version, and there are open issues with similar stacks: https://github.com/libunwind/libunwind/issues/150 https://github.com/libunwind/libunwind/issues/260 https://github.com/libunwind/libunwind/issues/473 Let's disable ENABLE_BACKTRACE for AArch64 Linux until these issues are resolved in libunwind. Closes #8572 Part of #8791 NO_DOC=bugfix (cherry picked from commit 418e749c)
-
Ilya Verbin authored
The ability to support backtraces is checked in cmake/compiler.cmake, it makes no sense to duplicate the check in rpm/tarantool.spec. Also do not enable backtraces unconditionally in apk/APKBUILD and static-build. Part of #6998 NO_DOC=build NO_TEST=build NO_CHANGELOG=build (cherry picked from commit f7c4a34a)
-
Aleksandr Lyapunov authored
There's case when a transaction is rolled back from prepared state. This happens when WAL fails, synchronized replication confirmation failure or perhaps in other similar cases. By design other RW transactions and transactions with READ_COMMITTED isolation level are allowed to read prepared state. All these transactions must be aborted in case of rollback of prepared transaction since they definitely have read no more possible database state. This patch implements this abortion. Closed #8654 NO_DOC=bugfix (cherry picked from commit 54986902)
-
Aleksandr Lyapunov authored
Rollback is rather complicated part if MVCC implementation that is meant to handle two kinds of rollback: * rollback from in-progress state, if box.rollback() is called. * rollback from prepared state, when WAL fails. Unfortunately the last one was not properly tested and surely has at least one flaw. When an inserting transaction becomes prepared its stories could be linked as deleted (via del_stmt pointer) by other in-progress transactions in order to maintain correct visibility. The problem is that in case of rollback of such prepared transaction those links remained. Broken links breaks the chain structure, and some older changes (that were linked as deleted before that hapless preparation) can become visible to other transaction. Refactor, simplify a bit that part of code and fix the issue described above; cover with tests. Closes #8648 NO_DOC=bugfix (cherry picked from commit 85569d9c)
-
Aleksandr Lyapunov authored
Almost completely rewrite, simplify and comment this part of code. Part of #8648 Part of #8654 NO_DOC=refactoring NO_TEST=refactoring NO_CHANGELOG=refactoring (cherry picked from commit e9015074)
-
Aleksandr Lyapunov authored
Almost completely rewrite, simplify and comment this part of code. Part of #8648 Part of #8654 NO_DOC=refactoring NO_TEST=refactoring NO_CHANGELOG=refactoring (cherry picked from commit 63da3bed)
-
Aleksandr Lyapunov authored
The latter flag is a bit wider: it reveals not only inserting statements after deleting by the same transaction, but also replacing and deleting statements after all kinds of previois changes but the same transaction. This extended behavior will be used in further commits. Part of #8648 Part of #8654 NO_DOC=refactoring NO_TEST=refactoring NO_CHANGELOG=refactoring (cherry picked from commit 3cfa6756)
-
Aleksandr Lyapunov authored
It was an ugly solution when MVCC engine requires outside engine to set this flag which is not convenient. Remove it and use mode arguments to set up proper read trackers. Part of #8648 Part of #8654 NO_DOC=refactoring NO_TEST=refactoring NO_CHANGELOG=refactoring (cherry picked from commit 74149734)
-
Aleksandr Lyapunov authored
The function memtx_tx_story_delete is expected to delete fully unlinked stories and thus should not try to unlink something by itself. So remove unlink and add asserts instead. Part of #8648 Part of #8654 NO_DOC=refactoring NO_TEST=refactoring NO_CHANGELOG=refactoring (cherry picked from commit 07067407)
-
Aleksandr Lyapunov authored
Now there are three kinds of very close trackers: * The transaction have read some tuple that is not committed and thus not visible. This kind is now stored as gap_item with is_nearby = false. * The transaction made a select or range scan, reading a key or range between two adjacent tuples of the index. This kind is stored as gap_iteam with is_nearby = true. * A transaction completed a full scan of unordered index. This kind is stored as full_scan_item. All these trackers serve for the same thing: to record a fact that a transaction read something but didn't see anything. There are some problems with the current solution: * gap_item with is_nearby = false has several unused members that just consume space. * bool is_nearby flag for type descriptin is an ugly solution. * full_scan_item is separated from logically close items. This commit joins all these trackers under one base (that is struct gap_item_base) and solves problems above. Part of #8648 Part of #8654 NO_DOC=refactoring NO_TEST=refactoring NO_CHANGELOG=refactoring (cherry picked from commit f8d97a2e)
-
Aleksandr Lyapunov authored
Now read trackers are used both for cases when a transaction has read an existing value and it has read nothing (read by key but there was no visible tuple in this place). For latter case an additional index_mask was used to identify from which index the read was done. Along with that there was per-index interval gap trackers. This patch divides area of responsibility between read trackers and gap tracker in the following way: * Reads of existing visible values are stored in read trackers. * Reads of non-existing or non-visible values are store in gap trackers. This new approach allows to provide new invariants: gap trackers are stored only at top of chain, and read trackers are stored only at topmost committed story in chain. Part of #8648 Part of #8654 NO_DOC=refactoring NO_TEST=refactoring NO_CHANGELOG=refactoring (cherry picked from commit 7b8b78be)
-
Aleksandr Lyapunov authored
In further commit this list will be used for tracking all read gaps, not only 'nearby'. Since this rename has rather huge diff, let's make it in separate commit. No logical changes. Part of #8648 Part of #8654 NO_DOC=refactoring NO_TEST=refactoring NO_CHANGELOG=refactoring (cherry picked from commit d3feb691)
-
Aleksandr Lyapunov authored
In our SQL implementation temporary spaces are used. They come to MVCC engine in two variants - NULL or ephemeral. In both cases MVCC engine must not do anything, there are several checks for that in different parts of code. Normalize these checks and make them similar to each other. Part of #8648 Part of #8654 NO_DOC=refactoring NO_TEST=refactoring NO_CHANGELOG=refactoring (cherry picked from commit 86a8155c)
-
Aleksandr Lyapunov authored
The only place where this static function is used is more general static function - memtx_tx_track_read_story. This is a bit confusing - usually slow variant stand for public inline 'fast' method. So merge both functions in one. Part of #8648 Part of #8654 NO_DOC=refactoring NO_TEST=refactoring NO_CHANGELOG=refactoring (cherry picked from commit 32e41b7a)
-
Aleksandr Lyapunov authored
By a mistake in 8a565144 a shortcut was added to procedure that handles gap write: it was considered that if the writing transaction is the same as reading - there is no actual conflict that must be stored further. That was a wrong decision: if such a transaction yields and another transaction comes and commits a value with the same key - the first one must go to conflicted state since it has read no more possible state. Another similar mistake was made in e6f5090c, where writing after full scan of the same transaction was not tracked as read. Obviously that was wrong: if some other transaction overwrites the key and commits - this transaction must go to read view since it did not see anything by this key which is not so anymore. Fix it, reverting the first commit and an modifying the second and add a test. Closes #8326 NO_DOC=bugfix (cherry picked from commit b41c4546)
-
Aleksandr Lyapunov authored
There's a special 'point hole' mechanism in mvcc transactional manager that manages point gap reads by full key when no raw tuple was found in the index. For instance, it's the only way to collect gap reads for non-tree indexes. Once a new tuple is inserted to the index, the read records are transferred to the normal read set in the corresponding story. Actually after that the 'point hole' record in no more needed. So let's remove it. While we are here, drop unused point_holes_size, improve names and comments. Part of #8648 Part of #8654 NO_DOC=refactoring NO_TEST=refactoring NO_CHANGELOG=refactoring (cherry picked from commit 62c65639)
-
Aleksandr Lyapunov authored
Before this patch there were several different places in the code that deal with referencing tuple in space, setting in_index member and marking the story as retained or not. But logically all above is about the same - about placing a story to the top of a chain, i.e. the first story in version list to which index points. This commit refactors these things a bit. This mostly relates to two functions - memtx_tx_story_new and memtx_tx_story_link_top. Changes in memtx_tx_story_new are based on the fact that if a story is created by tuple, it is or immediately will be at the top of chain. Considering this we can omit argument `is_referenced_to_pk` and always create a story ready to be in top of chain. If a story is already in the top - nothing else is needed; if it is to become the top - memtx_tx_story_link_top must be called after. Further, linking to top of chain is needed exactly in two cases: * if a story just created by memtx_tx_story_new must become a top * if a chain is reordered involving the top story (the top and the next stories are swapped) These two cases are logically very close but still different. Even more, previously there were two functions for that: memtx_tx_story_link_top_light and memtx_tx_story_link_top correspondingly. This commit introduces one function for that (although with one more argument) that also incapsulates activities about referencing tuples and marking stories as retained. After this patch the rules are logical and simple: * if a tuple is inserted - call _story_new and _link_top(.. true). * if a story of existing clean tuple is needed - call _story_new. * if a chain is reordered involving top story - _link_top(.. false). Part of #8648 Part of #8654 NO_DOC=refactoring NO_TEST=refactoring NO_CHANGELOG=refactoring (cherry picked from commit 202340b7)
-
Aleksandr Lyapunov authored
Remove runtime allocation error handling and use panic-on-fail versions of allocation functions. Reasons for that: * Memory error handling was never tested an probably doesn't work. * Some return codes was ignored so the code had obvious flaws. * Rollback in case of memory error made some code overcomplicated. Part of #8648 Part of #8654 NO_DOC=no new functionality added NO_TEST=no new functionality added NO_CHANGELOG=no new functionalily added (cherry picked from commit c951c9de)
-
Aleksandr Lyapunov authored
Conflict trackers are used to store information that if some transaction is committed then some another transaction must be aborted. This happens when the first transaction writes some key while the other reads the same key. On the other hand there are another trackers - read trackers - that are designed to handle exactly the same situation. That's why conflict trackers can be simply replaced with read trackers. That would allow to remove conflict trackers as not needed anymore. Part of #8648 Part of #8654 NO_DOC=refactoring NO_TEST=refactoring NO_CHANGELOG=refactoring (cherry picked from commit a6c2b9ff)
-
Aleksandr Lyapunov authored
If addition of a tuple is rolled back while the corresponding story is needed for something else (for example it stores a read set of another transaction) - the story cannot be deleted. Now there's a special flag `rollbacked` that is set to true for such stories, and the flag must be considered in places where history chains are scanned. That approach also requires psn to be set for rolled-back transactions, which surprisingly not as simple as it to say. All that makes the code complicated and hard to maintain. There's another approach for managing rolled back stories: simply set their del_psn to a low enough value (lower than any existing transaction's PSN) and (if necessary) push them to the end of history chain. Such a story would be invisible to any transaction due to already existing mechanisms, that's what is needed. In order to provide "low enough" del_psn it will be natural to assign real PSN starting from some predefined value, so any value below that predefined value will be less that any existing PSN and thus "low enough". Implement this more simple approach. Part of #8648 Part of #8654 NO_DOC=refactoring NO_TEST=refactoring NO_CHANGELOG=refactoring (cherry picked from commit ba394a58)
-
Aleksandr Lyapunov authored
That's strange, but in this test in a group of simple test cases there are test cases that checks replaces, updates and deletes, but occasionally there's no test case that checks inserts. Fix it and add simple test cases for inserts. No logical changes. Part of #8648 Part of #8654 NO_DOC=new test case NO_CHANGELOG=new test case (cherry picked from commit 37b4561f)
-
- Jun 21, 2023
-
-
Oleg Jukovec authored
The description of CURLOPT_UPLOAD [1] is confusing: If you use PUT to an HTTP 1.1 server, you can upload data without knowing the size before starting the transfer if you use chunked encoding. You enable this by adding a header like "Transfer-Encoding: chunked" with CURLOPT_HTTPHEADER. In fact, libcurl adds this header itself. Actually we need to avoid adding this header by libcurl with CURLOPT_INFILESIZE [2]. The CURLOPT_UPLOAD documentation has been updated [3]. 1. https://github.com/curl/curl/blob/555bacd6d522bcca497573765056354f4d5d7b33/docs/libcurl/opts/CURLOPT_UPLOAD.3 2. https://curl.se/libcurl/c/httpput.html 3. https://github.com/curl/curl/pull/11300 Closes #8744 NO_DOC=bugfix (cherry picked from commit e2e5ef4b)
-
- Jun 20, 2023
-
-
Vladimir Davydov authored
This reverts commit 1c0a0c90. Cherry-picked by mistake. Tarantool 2.11 still depends on libgomp. NO_DOC=revert NO_TEST=revert NO_CHANGELOG=revert
-
Ilya Verbin authored
It was disabled because ligomp.a on some AArch64 systems (e.g. CentOS) is compiled without PIC support. Now Tarantool doesn't depend on ligomp, so it's safe to turn on PIC for AArch64 systems. Follow-up #7536 NO_DOC=build NO_TEST=build (cherry picked from commit 5c1968ca)
-
Ilya Verbin authored
It was disabled because dlsym tests failed when PIC is on (#7640). However, later it turned out that the issue is not related to PIC, and LuaJIT was turned off for such tests by commit 67e79b15 ("test: turn LuaJIT off in tests with dlsym"). Now it's safe to turn on PIC for FreeBSD. Follow-up #7536 NO_DOC=build NO_TEST=build (cherry picked from commit 05eba830)
-
- Jun 19, 2023
-
-
Yaroslav Lobankov authored
It was decided to include the `osx_debug.yml` and `osx_release.yml` workflows to the default tests run (without the `full-ci` label). Now we can get test results for macOS faster and without an extra load on CI. NO_DOC=ci NO_TEST=ci NO_CHANGELOG=ci (cherry picked from commit de404cb0)
-
Nikita Zheleztsov authored
Commit/rollback triggers are run asynchronously, upon receiving the write status from WAL. We can't run them in the original fiber that submitted the WAL request, because it would open a time window between writing a transaction to WAL and committing it in tx, which could lead to violating the cascading rolback principles. As a result, commit/rollback triggers run with admin privileges. The issue was already solved for confirming async transaction, but session and user are still not correct, when the transaction is confirmed by the limbo. Let's fix this issue by temporarily setting session and credentials to the original fiberfor running commit/rollback triggers. Closes #8742 NO_DOC=bugfix (cherry picked from commit 8cd0cd09)
-