- Aug 10, 2023
-
-
Magomed Kostoev authored
Since number type was introduced we can not assume if tuples are equal by comparison then their sizes are equal too. So the place the assumption is used is fixed. Closes #8899 NO_DOC=bugfix
-
Vladimir Davydov authored
Getting rid of C++ exception is our long term goal. This commit removes the exceptions from the IPROTO code as follows: - Make iproto_set_msg_max return -1 instead of raising an exception on error. Update box_set_net_msg_max accordingly. - Make box_process_auth return -1 instead of raising an exception on error. Move it along with box_process_vote (which never fails) to the extern "C" namespace. - Remove try/catch from iproto_connection_on_input, tx_process_misc, tx_process_connect. Use a label instead. - Panic instead of raising an exception on an error starting an IPROTO thread in iproto_init. It should be fine because the function is called only at startup and shouldn't normally fail. - Remove try/catch from iproto_do_cfg_f. It turns out that this function never fails so we don't even need to use an error label. - Drop iproto_do_cfg_crit and move the assertion to iproto_do_cfg because this function should never fail and so we don't need the wrapper. After this commit, the only exception-handling piece of code left in IPROTO is tx_process_replication. Dropping it would entail patching replication, relay, and recovery code so it was postponed. NO_DOC=code cleanup NO_TEST=code cleanup NO_CHANGELOG=code cleanup
-
Vladimir Davydov authored
The buffer is unlimited so allocations from it never fail. Even if decide to add a hard limit some day, it's better to do it somewhere in one place to simplify testing so the dropped code isn't going to be needed. NO_DOC=code cleanup NO_TEST=code cleanup NO_CHANGELOG=code cleanup
-
Vladimir Davydov authored
The mempools are unlimited so allocations from them never fail. Even if we decide to add a hard limit some day, it's better to do it somewhere in one place to simplify testing so the dropped code isn't going to be needed. NO_DOC=code cleanup NO_TEST=code cleanup NO_CHANGELOG=code cleanup
-
Vladimir Davydov authored
malloc isn't supposed to fail so let's use xmalloc helper in rmean_new and get rid of allocation failure paths. NO_DOC=code cleanup NO_TEST=code cleanup NO_CHANGELOG=code cleanup
-
- Aug 09, 2023
-
-
Vladimir Davydov authored
The new function is a wrapper around the socketpair system call. It takes the same arguments as the socket constructor and returns two socket objects representing the two ends of the newly created socket pair on success. It may be useful for establishing a communication channel between related processes. Closes #8927 @TarantoolBot document Title: Document new socket functions Two socket module functions and one socket object method were added to Tarantool 3.0: - `socket.from_fd(fd)`: constructs a socket object from the file descriptor number. Returns the new socket object on success. Never fails. Note, the function doesn't perform any checks on the given file descriptor so technically it's possible to pass a closed file descriptor or a file descriptor that refers to a file, in which case the new socket object methods may not work as expected. - `socket:detach()`: like `socket:close()` but doesn't close the socket file descriptor, only switches the socket object to the closed state. Returns nothing. If the socket was already detached or closed, raises an exception. Along with `socket.from_fd`, this method may be used for transferring file descriptor ownership from one socket to another: ```Lua local socket = require('socket') local s1 = socket('AF_INET', 'SOCK_STREAM', 'tcp') local s2 = socket.from_fd(s1:fd()) s1:detach() ``` - `socket.socketpair(domain, type, proto)`: a wrapper around the [`socketpair`][1] system call. Returns two socket objects representing the two ends of the new socket pair on success. On failure, returns nil and sets [`errno`][2]. Example: ```Lua local errno = require('errno') local socket = require('socket') local s1, s1 = socket.socketpair('AF_UNIX', 'SOCK_STREAM', 0) if not s1 then error('socketpair: ' .. errno.strerror()) end s1:send('foo') assert(s2:recv() == 'foo') s1:close() s2:close() ``` [1]: https://man7.org/linux/man-pages/man2/socketpair.2.html [2]: https://www.tarantool.io/en/doc/latest/reference/reference_lua/errno/
-
Vladimir Davydov authored
The new socket object method is equivalent to socket:close except it doesn't close the underlying socket file descriptor - it just switches the socket object to the closed state. It may be useful for transferring fd ownership from a socket object, to for example, a net.box connection. Part of #8927 NO_DOC=later NO_CHANGELOG=later
-
Vladimir Davydov authored
The new function constructs a socket object from a file descriptor number. No checks are performed on the given fd so the user may pass a closed fd or a fd that refers to a file, in which case the socket object methods will fail and/or work not as expected. It may be useful for creating a socket object from a file descriptor inherited from a parent process. The only tricky part here is setting the socket itype, which is used for setting the correct receive buffer size for datagram sockets, see commit 11fb3ab9 ("socket: evaluate buffer size in recv / recvfrom"). On error the itype is silently set to 0. Part of #8927 NO_DOC=later NO_CHANGELOG=later
-
- Aug 08, 2023
-
-
Nikolay Shirokovskiy authored
Small library currently depends on Tarantool core through 'exception.h'. This is not the way to go. Let's drop this dependency and instead of moving _xc functions to Tarantool repo we can just stop using them. Our current policy is to panic on OOM in case of runtime allocation. Part of #7327 NO_DOC=<OOM behaviour is not documented> NO_CHANGELOG=<no OOM expectations> NO_TEST=<no test harness for checking OOM>
-
Sergey Ostanevich authored
The test can be used for regression testing. It is advisable to tune the machine: check the NUMA configuration, fix the pstate or similar CPU autotune. Although, running dozen times gives more-less stable result for the peak performance, that should be enough for regression identification. NO_DOC=adding an internal test NO_CHANGELOG=ditto NO_TEST=ditto
-
Aleksandr Lyapunov authored
There must be a couple of rules: * foreign key from non-temporary space to temporary space must be forbidden since after restart all existing links will be broken. * foreign key from non-local space to local space must be forbidden on any replica all existing can be broken. This patch implements the rules. Closes #8936 NO_DOC=bugfix
-
- Aug 07, 2023
-
-
Vladimir Davydov authored
The test fails on osx_debug quite frequently with the following error: NO_WRAP > box/before_replace.test.lua [ fail ] > > Test failed! Result content mismatch: > --- box/before_replace.result Mon Aug 7 10:36:06 2023 > +++ /tmp/t/rejects/box/before_replace.reject Mon Aug 7 10:42:03 2023 > @@ -899,6 +899,7 @@ > ... > for i = 1,17 do gen_inserts() end > --- > +- error: fiber slice is exceeded > ... > test_run:cmd('restart server test') > s = box.space.test_on_schema_init > @@ -906,7 +907,7 @@ > ... > s:count() > --- > -- 1 > +- 0 > ... > -- For this test the number of invocations of the before_replace > -- trigger during recovery multiplied by the amount of return values > @@ -921,7 +922,8 @@ > -- the value is only increased by 1, and this change is visible only in memory. > s:get{1}[2] == 1 + 16999 + 17000 + 1 or s:get{1}[2] > --- > -- true > +- error: '[string "return s:get{1}[2] == 1 + 16999 + 17000 + 1 o..."]:1: attempt to > + index a nil value' > ... > test_run:cmd('switch default') > --- NO_WRAP Let's try to increase the max fiber slice up to 15 seconds to avoid that, like we do in other potentially long tests. (The default value is 1 second.) NO_DOC=test fix NO_CHANGELOG=test fix
-
Vladimir Davydov authored
This should suppress the following coverity issues: https://scan7.scan.coverity.com/reports.htm#v39198/p13437/fileInstanceId=146712118&defectInstanceId=18978766&mergedDefectId=1563095 https://scan7.scan.coverity.com/reports.htm#v39198/p13437/fileInstanceId=146712113&defectInstanceId=18978750&mergedDefectId=1563094 While we are at it, let's use space_by_id instead of space_cache_find because read view creation is a rare operation affecting all spaces so caching the last space by id doesn't make any sense. NO_DOC=code health NO_TEST=code health NO_CHANGELOG=code health
-
Aleksandr Lyapunov authored
In #7309 a truncation of a space that was referenced by foreign key from some other space was prohibited. It appeared that this solution is too bothering since a user can't truncate a space even if he truncated referring space before that. Fix it by allowing space truncate if referring spaces are empty. Also allow drop of the primary index in the same case with the same reason: logically the index along with all space data is not needed for consistency if there's no referring data. Note that by design space truncate is implemented quite similar to space drop. Both delete all indexes, from secondary to primary. Since this patch allows deletion of the primary index (which is the action that actually deletes all data from the space), this patch changes the result of space drop too: the space remains alive with no indexes, while before this patch it remained alive with no secondary indexes but with present primary. In both cases the behaviour is quite strange and must be fixed in #4348. To make tests pass I had to perform drop in box.atomic manually. Closes #8946 NO_DOC=bugfix
-
Vladimir Davydov authored
Closes #8926 @TarantoolBot document Title: Document `inherit_fds` option of `popen.new` The new option takes an array of file descriptor numbers that should be left open in the child process if the `close_fds` flag is set. If the `close_fds` flag isn't set, the option has no effect because in this case none of the parent's file descriptors are closed anyway. The option may be useful for establishing a communication channel between a Tarantool instance and a process spawned by it with `popen.new`, for example, using `socket.socketpair`.
-
Vladimir Davydov authored
Allocation from malloc and the fiber region never fail so we can use x* variants to simplify code and improve coverage. NO_TEST=code cleanup NO_CHANGELOG=code cleanup @TarantoolBot document Title: Remove `OutOfMemory` error from `popen.new` and `popen.read` These functions don't raise the `OutOfMemory` exception anymore so all mentions of it should be removed from the documentation: - https://www.tarantool.io/en/doc/latest/reference/reference_lua/popen/#popen-new - https://www.tarantool.io/en/doc/latest/reference/reference_lua/popen/#popen-read
-
Yaroslav Lobankov authored
Remove hard-coded compiler version for the `test-release-asan` target in the .test.mk file. NO_DOC=make NO_TEST=make NO_CHANGELOG=make
-
- Aug 04, 2023
-
-
Gleb Kashkin authored
This patch introduces all metrics configuration. Part of #8861 NO_DOC=tarantool/doc#3544 links the most actual schema, no need to update the issue.
-
Gleb Kashkin authored
Bump the metrics submodule to 1.0.0-3-4865675c NO_DOC=metrics submodule bump NO_TEST=metrics submodule bump NO_CHANGELOG=metrics submodule bump
-
Igor Munkin authored
All LuaJIT related LSan warnings were suppressed in the scope of the commit 985548e4 ("asan: suppress all LSAN warnings related to LuaJIT"), since all compiler flags tweaks were enclosed in LuaJIT CMake machinery. As a result of the commit in LuaJIT submodule tarantool/luajit@a86e376 ("build: introduce LUAJIT_USE_ASAN option") ASan and LSan support has been finally added to LuaJIT runtime, so it was decided to remove LSan suppressions for LuaJIT functions. Unfortunately, it was not so easy as it looked like. At first, Lua global state is not closed properly at Tarantool instance exit (see <tarantool_free> in src/main.cc and <tarantool_lua_free> in src/lua/init.c for more info), so LSan false-positive leaks are detected (for more info, see #3071). Hence, the original LSan suppression for lj_BC_FUNCC is returned back (temporarily) until the aforementioned issue is not resolved. Furthermore, the internal LuaJIT memory allocator is not instrumented yet, so to find any memory faults it's worth building LuaJIT with system provided memory allocator (i.e. enable LUAJIT_USE_SYSMALLOC option). However, again, since Tarantool doesn't finalize Lua universe the right way, so running Tarantool testing routine with LUAJIT_USE_SYSMALLOC enabled generates false-positive LSan leaks. Return back here to enable LUAJIT_USE_SYSMALLOC, when #3071 is resolved. Last but not least, the default value of fiber stack size is 512Kb, but several tests in test/PUC-Rio-Lua-5.1-test suite in LuaJIT submodule (e.g. some cases with deep recursion in errors.lua or pm.lua) have already been tweaked according to the limitations mentioned in #5782, but the crashes still occur while running LuaJIT tests with ASan support enabled. Experiments once again confirm the notorious quote that "640 Kb ought to be enough for anybody". Anyway, LuaJIT tests are added to <test-release-asan> target in .test.mk and LUAJIT_TEST_ENV is extended with required ASan and LSan options. Follows up #5878 NO_DOC=ci NO_TEST=ci NO_CHANGELOG=ci
-
- Aug 03, 2023
-
-
Alexander Turenko authored
It is convenient to access configuration using `config:get()` from the application script (`app.file` or `app.module`). However, before this commit, it was not possible, because the configuration was not considered as applied before the application script is loaded. Now, the script loading is moved into the post-apply phase. The resulting sequence of steps on startup/reload is the following. * collect configuration information (from all the sources) * <if the previous step is failed, set `check_errors` status and break> * apply the configuration (call all the appliers) * <if the previous step is failed, set `check_errors` status and break> * <set the new successful status: `ready` or `check_warnings`> * call post-apply hooks (including application script loading) * <if the previous step is failed, set `check_errors` status and break> * <set the new successful status: `ready` or `check_warnings`> I would like to briefly comment the changes in the tests. * `app_test.lua`: added the check for the new behavior (call config:get() from the app script) * `appliers_test.lua`: fixed the applier call (`.apply` -> `.post_apply`) * `config_test.lua`: fixed status observed in the app script (`*_in_progress` -> `ready`) Part of #8862 NO_DOC=reflected in https://github.com/tarantool/doc/issues/3544
-
Alexander Turenko authored
The declarative config has the `app` section with following three parameters: * `app.file` -- the path to the script file * `app.module` -- the same, but the script is searched using the Lua search paths (and loaded using `require`) * `app.cfg` -- a user provided configuration (arbitrary map) This commit adds a few success/failure cases. The goal is to have simple test examples to add more ones easier in a future. Implemented several test helpers for typical scenarios that can be used outside of the application script test. Part of #8862 NO_DOC=testing improvements NO_CHANGELOG=see NO_DOC
-
- Aug 02, 2023
-
-
Alexander Turenko authored
The usual environment configuration source is useful for parametrized run: ``` TT_MEMTX_MEMORY=<...> tarantool --name <...> --config <...> ``` However, sometimes a user may need to set a default value, which doesn't rewrite one that is provided in the configuration. Now, it is possible to do using the environment variables with the `_DEFAULT` suffix. ``` TT_MEMTX_MEMORY_DEFAULT=<...> tarantool --name <...> --config <...> ``` This feature may be especially useful for wrappers that run tarantool internally with some default paths for data directories, socket files, pid file. We likely will use it in the `tt` tool. Part of #8862 NO_DOC=added into https://github.com/tarantool/doc/issues/3544 manually
-
Alexander Turenko authored
It simplifies code reusage in the following commit, which adds the second environment config source. Part of #8862 NO_DOC=no user-visible changes, just code refactoring NO_CHANGELOG=see NO_DOC NO_TEST=see NO_DOC
-
Oleg Chaplashkin authored
Bump test-run to new version with the following improvements: - luatest: fix detect tarantool crash at exit [1] - Fix bug when lua script name truncated by dot [2] - Raise an error and log it if test timeouts are set incorrectly [3] - Pin PyYAML version to 5.3.1 [4] - Add ability to set path to executable file [5] - Migrate tarantoolctl from tarantool repository [6] - Fix test-run crash when default server is crashed [7] - Disable reproduce content printing [8] [1] tarantool/test-run@be693d1 [2] tarantool/test-run@a6405f1 [3] tarantool/test-run@d34ecb0 [4] tarantool/test-run@704420e [5] tarantool/test-run@0a70001 [6] tarantool/test-run@ad43d8f [7] tarantool/test-run@b31329e [8] tarantool/test-run@31f0ced NO_DOC=test NO_TEST=test NO_CHANGELOG=test
-
Igor Munkin authored
* ci: introduce testing workflow with sanitizers * build: introduce LUAJIT_USE_ASAN option * test: introduce test:done TAP helper * memprof: remove invalid assertions * ci: clean up workflow for exotic builds Closes #5878 NO_DOC=LuaJIT submodule bump NO_TEST=LuaJIT submodule bump NO_CHANGELOG=LuaJIT submodule bump
-
Vladimir Davydov authored
The is_old compat option method is more reliable than comparing the current option value to 'old' directly because it may be set to 'default', in which case we also have to check the default value. Follow-up #8807 NO_DOC=refactoring NO_TEST=refactoring NO_CHANGELOG=refactoring
-
Vladimir Davydov authored
The is_new and is_old methods are the same for all compat options so they should be defined in a metatable. A good thing about this change is that it removes is_new and is_old from serialization: * Before: NO_WRAP tarantool> require('compat').yaml_pretty_multiline --- - is_new: 'function: 0x4175d6e8' is_old: 'function: 0x4175d790' brief: | Whether to encode in block scalar style all multiline strings or ones containing "\n\n" substring. The new behavior makes all multiline string output as single text block which is handier for the reader, but may be incompatible with some existing applications that rely on the old style. https://tarantool.io/compat/yaml_pretty_multiline current: default default: new ... NO_WRAP * After: NO_WRAP tarantool> require('compat').yaml_pretty_multiline --- - current: default brief: | Whether to encode in block scalar style all multiline strings or ones containing "\n\n" substring. The new behavior makes all multiline string output as single text block which is handier for the reader, but may be incompatible with some existing applications that rely on the old style. https://tarantool.io/compat/yaml_pretty_multiline default: new ... NO_WRAP To achieve that, we have to remove the option name from the usage error message but it seems to be okay because such errors shouldn't happen in practice and the error message is clear enough to figure out what went wrong. Follow-up #8807 NO_DOC=refactoring NO_CHANGELOG=refactoring
-
- Jul 31, 2023
-
-
Yaroslav Lobankov authored
Run release build LTO testing inside a Docker container created from the `tarantool/testing:ubuntu-jammy-clang16` image with Clang 16 installed. Closes #318 NO_DOC=ci NO_TEST=ci NO_CHANGELOG=ci
-
Yaroslav Lobankov authored
Run release build testing inside a Docker container created from the `tarantool/testing:ubuntu-jammy-clang16` image with Clang 16 installed. Closes #317 NO_DOC=ci NO_TEST=ci NO_CHANGELOG=ci
-
- Jul 28, 2023
-
-
Sergey Vorontsov authored
NO_DOC=build NO_TEST=build NO_CHANGELOG=build
-
Kirill Yukhin authored
Add code owners for CI-related script and for github automation directory. NO_CHANGELOG=no code changes NO_TEST=no code changes NO_DOC=no code changes
-
Alexander Turenko authored
The instance config schema was modified in commit 8ee2b0d8 ("config: start singleton instance in RW by default"): the `database.rw` (boolean) parameter was replaced by the `database.mode` parameter (enum of `ro` and `rw`). However, in the same commit, the default mode of an instance that is the only one in its replicaset was modified: it starts in the read-write mode by default. As result, the parameter is actually unneeded in the minimal configuration example. These changes were not reflected in the 'instance not found' error message, which contains the minimal configuration example. It is fixed here. Part of #8862 Follows up #8810 NO_DOC=nothing to document, it is just an error message NO_CHANGELOG=see NO_DOC NO_TEST=there is a test case in config-luatest/reload_test.lua that triggers the given error; it doesn't needs updating, because it checks the start of the error message
-
Igor Munkin authored
This patch reverts the temporary fix introduced in commit 53c94bc7 ("test: disable Lua JIT in app-luatest/http_client_test") since the issues with invalid traces generation for vararg functions are resolved, so JIT machinery can be enabled back then. Follows up #8718 Relates to #8516 NO_DOC=test NO_CHANGELOG=test
-
- Jul 27, 2023
-
-
Kirill Yukhin authored
In order to improve tests of Tarantool core assign dedicated team to perform review of each and every change. NO_CHANGELOG=no code changes NO_TEST=no code changes NO_DOC=no code changes
-
Gleb Kashkin authored
The following box.cfg options were described in instance_config with defaults similar to ones in box.cfg: * auth_type * auth_delay * disable_guest * password_lifetime_days * password_min_length * password_enforce_uppercase * password_enforce_lowercase * password_enforce_digits * password_enforce_specialchars * password_history_length Part of #8861 NO_DOC=tarantool/doc#3544 links the most actual schema, no need to update the issue.
-
Serge Petrenko authored
Applier thread uses lsregion to allocate the messages for tx thread. The messages are freed upon return to the applier thread using a corresponding lsr_id. Due to a typo, one of the lsregion allocations was made with a postfix increment of lsr_id instead of the prefix one. Essentially, part of a new message was allocated with an old lsr_id, and might be freed early by a return of a previous message. Fix this. Closes #8848 NO_DOC=bugfix NO_TEST=covered by asan in #8901 NO_CHANGELOG=bugfix
-
Nikita Zheleztsov authored
The test has two groups, in front of each of which, a cluster is created. Sometimes, it fails on the first test in every group: either ro_reason is explicitly checked and it equals to `orphan`, not nil, or we try to write to a still read-only instance and get the error, that it's orphan. The problem is the fact, that we don't wait until the connections are established in a cluster. Let's add waiting for full mesh in cluster creation. Closes tarantool/tarantool-qa#320 NO_CHANGELOG=test fix NO_DOC=test fix
-
- Jul 26, 2023
-
-
Sergey Vorontsov authored
Modify `actions/pack-and-deploy/action.yml` for creating static build packages and deploying them to the repository via RWS service. Modify `workflows/static_build_packaging.yml` for using this action. NO_DOC=ci NO_TEST=ci NO_CHANGELOG=ci
-
Sergey Vorontsov authored
Set variable `OUTPUT_DIR` in the .pack.mk file to the directory where static build packages will be stored. This directory will be used for the deployment. Add target `deploy-static` for deploying deb and rpm packages via RWS. NO_DOC=make NO_TEST=make NO_CHANGELOG=make
-