- Jul 26, 2023
-
-
Yaroslav Lobankov authored
Before these changes, it was impossible to define a custom absolute path for `OUTPUT_DIR` when calling the static-build/make_packages.sh script. The build failed due to missing directory inside the container. Also, set the default value for `OUTPUT_DIR` to the absolute path from where the static-build/make_packages.sh script runs instead of relative path to the static-build directory. NO_DOC=build NO_TEST=build NO_CHANGELOG=build
-
Nikita Zheleztsov authored
Currently if tarantool exits during relay's final join stage, corresponding thread isn't terminated. This causes the flakiness of the replicaset_ro_mostly.test.lua. Let's reuse the same relay, in which subscribe cord is running, for the final join stage. This way the cord will be cancelled during replication_free(). Closes #8082 NO_DOC=not user-visible NO_TEST=fix flaky test NO_CHANGELOG=not user-visible Co-authored-by:
Sergey Petrenko <sergepetrenko@tarantool.org>
-
- Jul 25, 2023
-
-
Vladimir Davydov authored
The normalize_position() internal function is called by select/pairs to prepare a position specified by the caller in the options.after argument to be passed to C over FFI. The function encodes the position passed as a table or a tuple in a temporary buffer obtained with cord_ibuf_take(). The problem is the cord buffer is already taken by the calling function (select/pairs) to encode the search key. As a result, cord_ibuf_take() allocates a new temporary buffer with malloc. Let's avoid this extra buffer allocation by passing the taken buffer to normalize_position(). Let's also remove the out arguments because they are always set to iterator_pos and iterator_pos_end and instead set iterator_pos and iterator_pos_end directly. To make this behavior clear, we rename normalize_position() to iterator_pos_set(). We also remove box.error() from this function and instead make it return true/false so that the caller can release the buffer on failure. perf/lua/box_select.lua test results: base patched get_0 159 153 (- 3%) get_1 243 243 (+ 0%) select_0 227 227 (+ 0%) select_1 343 336 (- 2%) select_5 2323 2305 (- 0%) select_10 6832 6866 (+ 0%) select_after_0 687 558 (- 18%) select_after_1 746 524 (- 29%) select_after_5 2917 2704 (- 7%) select_after_10 5033 4979 (- 1%) select_fetch_pos_0 239 233 (- 2%) select_fetch_pos_1 418 413 (- 1%) select_fetch_pos_5 2492 2496 (+ 0%) select_fetch_pos_10 5121 5179 (+ 1%) pairs_0 320 314 (- 1%) pairs_1 1060 1054 (- 0%) pairs_5 1466 1459 (- 0%) pairs_10 3749 3913 (+ 4%) pairs_after_0 788 670 (- 14%) pairs_after_1 1813 1611 (- 11%) pairs_after_5 2764 2638 (- 4%) pairs_after_10 4150 4098 (- 1%) tuple_pos 116 117 (+ 0%) NO_DOC=perf improvement NO_TEST=perf improvement
-
Vladimir Davydov authored
The test runs get, select, pairs space methods with various arguments in a loop and prints the average method run time in nanoseconds (lower is better). Usage: tarantool box_select.lua Output format: <test-case> <run-time> Example: $ tarantool box_select.lua --pattern 'get|select_%d$' get_0 155 get_1 240 select_0 223 select_1 335 select_5 2321 Options: --pattern <string> run only tests matching the pattern; use '|' to specify more than one pattern, for example, 'get|select' --read_view use a read view (EE only) Apart from the test, this patch also adds a script that compares test results: $ tarantool box_select.lua --pattern get > base $ tarantool box_select.lua --pattern get > patched1 $ tarantool box_select.lua --pattern get > patched2 $ tarantool compare.lua base patched1 patched2 base patched1 patched2 get_0 149 303 (+103%) 147 (- 1%) get_1 239 418 (+ 74%) 238 (- 0%) NO_DOC=perf test NO_TEST=perf test NO_CHANGELOG=perf test
-
Vladimir Davydov authored
This improves diff hunk name detection. Needed for checkpatch to correctly detect if patched code belongs to a function. NO_DOC=git NO_TEST=git NO_CHANGELOG=git
-
- Jul 24, 2023
-
-
Mergen Imeev authored
This patch introduces all flightrec options. Part of #8861 NO_DOC=Was already described before.
-
Mergen Imeev authored
Part of #8861 NO_DOC=Was already described before.
-
Mergen Imeev authored
This patch fixes an issue in generate_column_metadata(). Prior to this patch, the number of variable-only expressions was counted incorrectly when temporary memory was allocated on region to store their positions. However, although this allocation was incorrect, this did not lead to any problems due to the specifics of the region allocations. This patch fixes this by removing the temporary memory allocation. Closes #8763 NO_DOC=no user-visible changes NO_TEST=no user-visible changes NO_CHANGELOG=no user-visible changes
-
Georgy Moiseev authored
It is possible for interval to have days, hours, minutes and seconds larger than INT_MAX (or less than INT_MIN). Before this patch, msgpack decoding had failed to parse intervals with msgpack int64 and uint64. int64_t should be enough to store any value allowed for datetime intervals. Closes #8887 NO_DOC=small bug fix
-
Mergen Imeev authored
Part of #8861 NO_DOC=Was already described before.
-
- Jul 21, 2023
-
-
Mergen Imeev authored
This patch introduces all feedback options. Part of #8861 NO_DOC=Was already described before.
-
Sergey Kaplun authored
`api_check()` is the LuaJIT internal assertion. To prevent inconsistency during internal assertion changes (for example, during backporting), use glibc's `assert()` instead. NO_DOC=internal NO_TEST=internal NO_CHANGELOG=internal
-
- Jul 20, 2023
-
-
Igor Munkin authored
* FFI: Fix recording of union initialization. * Fix maxslots when recording BC_VARG, part 2. * Fix maxslots when recording BC_VARG. * Fix BC_UCLO insertion for returns. * ci: update job concurrency group definition Part of #8825 NO_DOC=LuaJIT submodule bump NO_TEST=LuaJIT submodule bump
-
- Jul 19, 2023
-
-
Alexander Turenko authored
A few options were added into box.cfg during development of the declarative configuration module. As result the instance config schema misses them. We're going to add these new options in #8861. However, it would be nice to catch such situations automatically. The new test case verifies it. If a new box.cfg() option will be added or a default value of an existing option will be changed, the test case will highlight it to let a human decide what to do with the declarative config. Part of #8861 NO_DOC=testing change NO_CHANGELOG=see NO_DOC
-
Alexander Turenko authored
box.cfg.vinyl_write_threads is 4 by default. Let's set the same value in the declarative config as the default. It seems, it was set to 2 by mistake. Part of #8861 NO_DOC=bugfix NO_CHANGELOG=the option is introduced after 3.0.0-alpha1 and there were no (pre)releases after that
-
Georgy Moiseev authored
Before this patch, one couldn't create new datetime interval with boundary value from Lua. At the same time, it was possible to create such interval from Lua through addition and subtraction. C range verification allow to create boundary value intervals, error message also implies that they should be allowed. (See #8878 for more info.) Closes #8878 NO_DOC=small bug fix
-
Nikolay Shirokovskiy authored
This fixes gh_8613_new_cli_behaviour_test run with my custom .inputrc (I use vi-cmd-mode-string/vi-ins-mode-string). We already reset readline configuration in interactive_tarantool.lua. Follows up ground works done for #7774 NO_DOC=test harness NO_TEST=test harness NO_CHANGELOG=test harness
-
- Jul 14, 2023
-
-
Vladimir Davydov authored
To achieve that, we bypass the read-only check for the _truncate system space in box_process1() and perform it in the on_replace system trigger instead, when we know which space is truncated. Note, we have to move the check for insertion of a new record into the _truncate system space before the read-only check in the on_replace trigger callback; this is needed for initial recovery with a non-empty _truncate space to work. While we are at it, let's use recovery_state to make the check explicit. Closes #5616 @TarantoolBot document Title: Mention that temp and local spaces can be truncated in ro mode DML operations on temporary and local spaces can be performed even if the instance is in the read-only mode, but DDL operations (such as `alter`) are forbidden in this case[^1]. Technically, `truncate` is a DDL operation so initially it was forbidden as well. However, it should be safe to perform this operation on a temporary or local space because logically it only modifies the data stored in the space (like DML) and it isn't replicated (see tarantool/tarantool#4263). So starting from Tarantool 2.11.1 we allow users to truncate temporary spaces in the read-only mode. [^1]: https://www.tarantool.io/en/doc/latest/concepts/replication/repl_architecture/#replication-local
-
Vladimir Davydov authored
A read source iterator stores statements in a vy_history object using vy_history_append_stmt(). If a statement can be referenced, it's reference counter is incremented. If it can't, i.e. it belongs to a memory source, it's stored in a vy_history object without referencing. This works fine because memory sources are append-only. A problem arises only when we get to scanning disk sources. Since we yield while reading disk, a dump task may complete concurrently dropping the memory sources and possibly invalidating statements stored in the iterator history. Although we drop the history accumulated so far and restart the iteration from scratch in this case, there's still an issue that can result in a use-after-free bug in vy_read_iterator_next(). The problem is that we access the current candidate for the next statement while evaluating a disk source after a disk read. If 'next' refers to a referenced statement, it's fine, but if it refers to a statement from a memory source, it may cause use-after-free because the memory source may be dropped during a disk read. To fix this issue, let's make vy_history_append_stmt() copy statements coming from memory sources. This should be fine performance-wise because we copied memory statements eventually in vy_history_apply() anyway, before returning them to the user. Note that we also have to update vy_read_iterator_restore_mem() because it implicitly relied on the fact that 'next' coming from a memory source can't be freed by vy_mem_iterator_restore(), which cleans up the memory source history. Now, it isn't true anymore so we have to temporarily take a reference to 'next' explicitly. Closes #8852 NO_DOC=bug fix NO_TEST=tested by ASAN
-
Rimma Tolkacheva authored
This refactoring will: 1. Move macros from a header to the source file. Macros should be used in header only with undef to avoid redefinitions. Undef directive is not useful since we want to use these macros in the source file. 2. Remove `using namespace lua_grammar` from header. https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rs-using-directive 3. Moving serializer entry point and constant parameters into luajit_fuzzer namespace. It's a common practice in C++ to avoid name collisions. 4. Move serializer functions into anonymous namespace. These functions are not a part of the interface so should have static linkage. https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rs-unnamed2 5. Fix ConvertToStringDefault function. It was logically wrong so it would generate an identifier `123` from `*123`. NO_CHANGELOG=internal NO_DOC=fuzzer fix
-
klauwier authored
LuaJIT fuzzer used to stop due to timeout caused by infinite cycles and recursions. Counters were introduced for every cycle and function to address LuaJIT fuzzer timeouts. The idea is to add unique counters for every cycle and function to ensure finite code execution, if it wasn't already. For while, repeat, for cycles, local and global named, anonymous functions, counters will be initialized before the code generated from protobuf, and checked in the first body statement. An entry point for the serializer was created to count cycles and functions for counter initialization. The idea was taken from a paper "Program Reconditioning: Avoiding Undefined Behaviour When Finding and Reducing Compiler Bugs" [1]. Here is an example of a change in serialized code made by this commit. Before: ```lua while (true) do foo = 'bar' end function bar() bar() end ``` After: ```lua counter_0 = 0 counter_1 = 0 while (true) do if counter_0 > 5 then break end counter_0 = counter_0 + 1 foo = 'bar' end function bar() if counter_1 > 5 then return end counter_1 = counter_1 + 1 bar() end ``` Protobuf structures that reproduce the timeout problem were added to the LuaJIT fuzzer corpus. [1] https://www.doc.ic.ac.uk/~afd/homepages/papers/pdfs/2023/PLDI.pdf NO_CHANGELOG=internal NO_DOC=fuzzer fix
-
klauwier authored
Cases in two switches had no breaks, so they were falling through. Breaks were added to solve the problem. Code generated by the LuaJIT fuzzer became more various. NO_CHANGELOG=internal NO_DOC=fuzzer fix
-
- Jul 13, 2023
-
-
Igor Munkin authored
In scope of the commit 82f4b4a3 ("lib/core/fiber: Increase default stack size") the default value of fiber stack size is increased up to 512 Kb (you can find the reasons in the aforementioned commit message and in https://github.com/tarantool/tarantool/issues/3418 description). Some of the tests in test/PUC-Rio-Lua-5.1-test suite in LuaJIT repo (e.g. some cases with deep recursion in errors.lua or pm.lua) have already been tweaked according to the limitations mentioned in https://github.com/tarantool/tarantool/issues/5782, but the crashes still occurs while running LuaJIT tests with ASan support enabled. To make the testing routine more convenient, FIBER_STACK_SIZE option is introduced to Tarantool CMake machinery. One can provide the size either by raw digits (i.e. in bytes) or using Kb/Mb suffixes for convenience. A couple of important nits: * If the given value is not a multiple of 4Kb, CMake machinery adjusts it up to the nearest one greater than this value. * If the adjusted value is less than 512Kb, configuration fails with the corresponding CMake fatal error. Follows up #3418 Relates to #5782 @TarantoolBot document Title: introduce FIBER_STACK_SIZE configuration option To make managing of the default fiber stack size more convenient, the corresponding CMake option is added. **NB**: The stack size can't be less than 512Kb and if the given value is not a multiple of 4Kb, CMake machinery adjusts it up to the nearest one greater than this value.
-
Gleb Kashkin authored
In the original commit 5f6d367c ("compat: add is_new and is_old to options") `compat.<option_name>:is_new()` and `:is_old()` were introduced, but by mistake they contained different usage messages. This patch updates `:is_new()` usage msg to more informative one from `:is_old()`. Follows up #8807 NO_CHANGELOG=changelog from 5f6d367c is valid NO_DOC=doc from 5f6d367c is valid
-
- Jul 12, 2023
-
-
Igor Munkin authored
There was a little mess in exports file regarding LuaJIT symbols to be visible from Tarantool binary, so some functions (e.g. <lua_tonumberx> and <lua_tointegerx>) were hidden unintentionally. As a result of the patch almost all public LuaJIT symbols are exported from Tarantool binary; there are still several functions reasonably hidden (you can find the rationale around the corresponding cases in the test file). Closes #3680 @TarantoolBot document Title: clean up LuaJIT exported functions The list of the LuaJIT-related functions being exported (i.e. public) from Tarantool should be updated. The actual list of the exported symbols can be found within changeset (either extra/exports file or related Lua test chunk).
-
Gleb Kashkin authored
It used to be somewhat complicated to check the effective value of a compat option, because `<option_name>.current` could contain 'default' state. This patch introduces helper functions that take care of that. The following alternatives were considered: * `compat.<option_name>.effective` - it is excessive in the presence if `current` and `default`, and is visible in serialization * `compat.<option_name>.get()` - while it is a function, it does only half of the work required, user still has to compare result to 'new' Closes #8807 @TarantoolBot document Title: Add `:is_new/old()` helpers to tarantool.compat options `compat.<option_name>.current` can be 'new', 'old' or 'default', thus when it is default there must be an additional check if `compat.<option_name>.default` is 'new'. It is handier to have a helper to deal with that instead of complicated `if`: * check if effective value is 'new' before the patch: ```lua if compat.<option_name>.current == 'new' or (compat.<option_name>.current == 'default' and compat.<option_name>.default == 'new') then ... end ``` * after the patch: ```lua if compat.<option_name>:is_new() then ... end ``` Please update [tutorial on using compat], maybe add an example to [Listing options details]. [tutorial on using compat]: https://www.tarantool.io/en/doc/latest/reference/reference_lua/compat/compat_tutorial/ [Listing options details]: https://www.tarantool.io/en/doc/latest/reference/reference_lua/compat/compat_tutorial/#listing-options-details
-
- Jul 10, 2023
-
-
Mergen Imeev authored
This patch introduces all remaining vinyl options that have not been introduced before. Part of #8861 NO_DOC=Was already described before.
-
Mergen Imeev authored
Prior to this patch, if a cluster configuration was not present or an instance was not found in the configuration during a reload, the error would begin with 'Startup failure'. Now it starts with 'Reload failure' in these cases. Part of #8862 NO_DOC=fix of error message
-
Alexander Turenko authored
All the tests are independent and nothing prevents running them in parallel. The option to enable the parallel running was just forgotten. Part of #8862 NO_DOC=testing change NO_CHANGELOG=see NO_DOC
-
- Jul 06, 2023
-
-
Sergey Bronnikov authored
Test uses a popen module that starts tarantool process in background mode. Tarantool process started in background mode forks a new process and closes a parent, after that popen loses a PID of the started process and `ph:kill()` and `ph:terminate()` doesn't work anymore. It leads to non-terminated tarantool processes after running the test. Patch fixes that by running `kill` using os.execute with a PID of tarantool process written to a pid file. Follows up #6128 NO_CHANGELOG=fix test NO_DOC=fix test
-
Ilya Grishnov authored
Fixed the implementation of the box console. Before this fix, result of `\set language` is shared between clients via `console.connect`, despite the fact that clients have different `box.session.id`. Now the parameter of the selected language is stored by each client in his own `box.session.storage`. Fixes #8817 NO_DOC=bugfix
-
- Jul 05, 2023
-
-
Mergen Imeev authored
This patch replaces region_*() functions with xregion_*() functions. NO_DOC=refactoring NO_TEST=refactoring NO_CHANGELOG=refactoring
-
Magomed Kostoev authored
1. Make double-formatted fields accept integer and float values. 2. Make indexes compare the values as double if the field key type is FIELD_TYPE_DOUBLE. 3. Make hashers cast double key field to double before hashing, so we are able to insert and select any int, uint, float or double if their value casted to double is equal (for double keys). Notes about tuple_compare.cc: Since now `mp_compare_double` casts any value placed in field to double it was renamed to `mp_compare_as_double` to not semantically conflict with existing `mp_compare_double_*` functions. Notes about tuple_hash.cc: The hashee cast result is encoded in MP_DOUBLE and hashed for backward compatibility reasons. Since now the field hashing function (tuple_hash_field) requires field type to hash the field correctly, a new parameter has been introduced. By the way added assertions to the generic `field_hash` to prevent invalid hashing for new precompiled hashers and made `key_hash_slowpath` static cause it's only used in this file. Closes #7483 Closes #5933 Unblocks tarantool/crud#298 @TarantoolBot document Title: It's not required to ffi-cast integral floating point to double anymore. The page describing tarantool data model states that: > In Lua, fields of the double type can only contain non-integer > numeric values... If the patch is merged this isn't the case anymore, so this statement and the code snippet below it should be updated. Link to the document: [Data storage](https://www.tarantool.io/en/doc/latest/concepts/data_model/value_store/#field-type-details). Affected segments: > double. The double field type exists mainly to be equivalent > to Tarantool/SQL’s DOUBLE data type. In msgpuck.h (Tarantool’s > interface to MsgPack), the storage type is MP_DOUBLE and the > size of the encoded value is always 9 bytes. In Lua, fields of > the double type can only contain non-integer numeric values and > cdata values with double floating-point numbers. Examples: 1.234, > -44, 1.447e+44. > > To avoid using the wrong kind of values inadvertently, use > ffi.cast() when searching or changing double fields. For example, > instead of space_object:insert{value} use ffi = require('ffi') > ... space_object:insert({ffi.cast('double',value)}). Example: > > ``` > s = box.schema.space.create('s', {format = {{'d', 'double'}}}) > s:create_index('ii') > s:insert({1.1}) > ffi = require('ffi') > s:insert({ffi.cast('double', 1)}) > s:insert({ffi.cast('double', tonumber('123'))}) > s:select(1.1) > s:select({ffi.cast('double', 1)}) > ```
-
Magomed Kostoev authored
This update pulls the following commits: * Add mp_read_double_lossy without direct convertibility checks * Fix mp_read_double_lossy tests freebsd build These commits introduce a function required to compare and hash msgpack values of double key fields as double. Need for #7483, #5933 NO_DOC=see the next commit NO_CHANGELOG=see the next commit
-
Kirill Yukhin authored
NO_DOC=no code changes NO_TEST=no code changes NO_CHANGELOG=no code changes
-
Alexander Turenko authored
Follows up #8724. NO_DOC=just add a changelog entry NO_TEST=see NO_DOC
-
Yaroslav Lobankov authored
Tarantool 3.0.0 is not going to be distributed as a set of packages for specific distros. Instead, it is planned to have a few `deb` and `rpm` packages with a statically compiled Tarantool binary inside, which will work on almost any distro. Also, we drop building packages with GC32. Now only GC64 packages will be shipped. Static build packaging was added at #8771. NO_DOC=ci NO_TEST=ci
-
- 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 Closes #8718 Part of #7900 Part of #8516 NO_DOC=LuaJIT submodule bump NO_TEST=LuaJIT submodule bump
-
Alexander Turenko authored
The following syntax variants are fobidden now: * user@ * user:pass@ * user@host:port * user:pass@host:port Only host:port is allowed (inet URI or unix socket URI). The idea is that we shouldn't distribute login/password information using the configuration, so it is better to explicitly forbid such usage of the option. Closes #8810 NO_DOC=the old behavior was not released, the documentation request will be registered manually NO_CHANGELOG=see NO_DOC
-
Alexander Turenko authored
Before this commit all the peers of the given replicaset were obligated to have suitable URI to connect -- either iproto.advertise.peer or one of iproto.listen URIs. Now replication.peers is successfully constructed if at least one suitable URI is constructed (except URI of the given instance itself). However, if an unknown user is used in the iproto.advertise.peer option of any peer, it is considered as an error (startup failure), just like before. The testing code for unsuccessful cases of replication.peers autobuilding is rewritten to reflect that just one bad peer doesn't cause a startup failure anymore. Now it also needs stripping of log messages, because the peers autobuilding tells about unsuitable URIs. Part of #8810 NO_DOC=the old behavior was not released, the documentation request will be registered manually NO_CHANGELOG=see NO_DOC
-