Skip to content
Snippets Groups Projects
  1. Mar 14, 2024
    • Yaroslav Lobankov's avatar
      ci: bump version of upload-artifact/download-artifact action · b012117d
      Yaroslav Lobankov authored
      Bump version of the `upload-artifact` and `download-artifact` actions
      to v4 for fixing an annoying warning that appears in GitHub WebUI:
      
          Node.js 16 actions are deprecated.
          Please update the following actions to use Node.js 20
      
      NO_DOC=ci
      NO_TEST=ci
      NO_CHANGELOG=ci
      b012117d
    • Georgiy Lebedev's avatar
      lua: add error autocompletion · 31b099aa
      Georgiy Lebedev authored
      Let's add an `__autocomplete` method to enable error autocompletion and
      make the error object easier to use. It will suggest error object fields
      (including own and inherited payload fields) and methods.
      
      Closes #9107
      
      NO_DOC=<not a documentable feature>
      31b099aa
    • Georgiy Lebedev's avatar
      lua: fix completion retrieval for cdata objects · cf644abd
      Georgiy Lebedev authored
      Cdata objects cannot have an `__autocomplete` metamethod (it's our custom
      metamethod). To work this around, we should also lookup the
      `__autocomplete` method using an object's `__index` metamethod.
      
      Part of #9107
      
      NO_CHANGELOG=<not a reported bug>
      NO_DOC=<bugfix>
      cf644abd
  2. Mar 13, 2024
    • Andrey Saranchin's avatar
      trigger: log error in triggers that does not throw an error · 2adfc662
      Andrey Saranchin authored
      Now on_access_denied and on_schema_init triggers do not throw error,
      so it just sinks into oblivion, which is not good because a thrown error
      indicates that something went wrong and database administrator should be
      definitely notified about it.
      
      The commit makes Tarantool log errors thrown from these triggers with
      error level. Also, the commit adds a test checking if all triggers are
      either raise an error or log it.
      
      Closes #9309
      
      @TarantoolBot document
      Title: Mention that triggers are guaranteed to throw an error or log it
      
      Now all triggers are either have a direct impact on the execution flow
      (e.g. close a connection or throw an error) or print a message to error
      log when they throw an error.
      
      We have a separate entry for triggers in Tarantool documentation, which
      lists the properties of the triggers - I think it's a perfect place for
      this new property.
      2adfc662
    • Nikolay Shirokovskiy's avatar
      lua: encode arguments as error payload for ClientError · 3978d54b
      Nikolay Shirokovskiy authored
      If we start to encode client error arguments as payload in C it is good
      to have same behavior for Lua too. So that for example
      `box.error.new(box.error.TUPLE_NOT_FOUND, 'space A', 'index B') will
      create error with payload fields 'space' and 'index' with corresponding
      values.
      
      Follow up #9109
      
      NO_CHANGELOG=internal
      NO_DOC=internal
      3978d54b
    • Nikolay Shirokovskiy's avatar
      lua/error: factor out luaT_error_payload_set · a2fd7866
      Nikolay Shirokovskiy authored
      Follow up #9109
      
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      NO_DOC=refactoring
      a2fd7866
    • Nikolay Shirokovskiy's avatar
      box: prepare to encode client error args as payload · b004a20e
      Nikolay Shirokovskiy authored
      With new harness we can specify in 'errcode.h' for example
      
      ```c
      	_(ER_TUPLE_NOT_FOUND, 4, "Tuple doesn't exist", "space", STRING, "index", STRING) \
      ```
      
      and then on
      
      ```c
      	diag_set(ClientError, ER_TUPLE_NOT_FOUND, "space A", "index B")
      ```
      
      the error set will have payload fields "space" and "index" with
      corresponding values.
      
      Closes #9109
      
      NO_CHANGELOG=internal
      NO_DOC=internal
      b004a20e
    • Nikolay Shirokovskiy's avatar
      core: add helpers to add MsgPack payload to error · 68225fb9
      Nikolay Shirokovskiy authored
      Part of #9109
      
      NO_CHANGELOG=INTERNAL
      NO_DOC=internal
      68225fb9
    • Nikolay Shirokovskiy's avatar
      test: make mp_error unit test tap compatible · bbcb7ad8
      Nikolay Shirokovskiy authored
      Part of #9109
      
      NO_CHANGELOG=internal
      NO_DOC=internal
      bbcb7ad8
    • Nikolay Shirokovskiy's avatar
      box/error: make numbering of error codes explicit · dd9fd3ab
      Nikolay Shirokovskiy authored
      This makes backport patches with new error codes more clean. Also we can
      use error codes with high numbers for testing in the next patch.
      
      ER_SQL_CANT_RESOLVE_FIELD message is changed as it has non ascii symbol '`'
      which is prohibited by checkpatch.
      
      Part of #9109
      
      NO_CHANGELOG=refactoring
      NO_DOC=refactoring
      dd9fd3ab
    • Alexander Turenko's avatar
      test: make cluster load all instances from config · e1af54f9
      Alexander Turenko authored
      
      Currently, it loads only instances defined in replicaset-001 of
      group-001. Let's load all instances so that we can start a cluster
      consisting of multiple replicasets.
      
      NO_DOC=testing helper update
      NO_CHANGELOG=see NO_DOC
      
      Co-authored-by: default avatarVladimir Davydov <vdavydov@tarantool.org>
      e1af54f9
    • Alexander Turenko's avatar
      test: rename replicaset helper to cluster · 7b7db412
      Alexander Turenko authored
      
      A replicaset isn't enough for out goal. We need a whole cluster.
      Let's start with renaming replicaset to cluster.
      
      NO_DOC=testing helper update
      NO_CHANGELOG=see NO_DOC
      
      Co-authored-by: default avatarVladimir Davydov <vdavydov@tarantool.org>
      7b7db412
    • Alexander Turenko's avatar
      test: allow to select group and replicaset in config builder · d431cdd0
      Alexander Turenko authored
      
      It's now possible to select a custom replicaset for following calls,
      such as :add_instance(), in the config builder with the new methods
      :use_group() and :use_replicaset(). This is necessary for creating
      clusters spanning multiple replicasets.
      
      NO_DOC=testing helper update
      NO_CHANGELOG=see NO_DOC
      
      Co-authored-by: default avatarVladimir Davydov <vdavydov@tarantool.org>
      d431cdd0
    • Sergey Bronnikov's avatar
      c: bump version of actions/checkout · 8aff2ede
      Sergey Bronnikov authored
      Bump version of actions/checkout to v4.
      Bump fixes an annoying warning that appears in Github WebUI:
      
      Node.js 16 actions are deprecated. Please update the following actions
      to use Node.js 20: actions/checkout@v3. For more information see:
      https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
      
      Version of the action in workflow static_build_pack_test_deploy.yml
      remains the same because Node.js 20 is failed on CentOS 7 with error:
      
      /__e/node20/bin/node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by /__e/node20/bin/node)
      /__e/node20/bin/node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /__e/node20/bin/node)
      /__e/node20/bin/node: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /__e/node20/bin/node)
      /__e/node20/bin/node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /__e/node20/bin/node)
      /__e/node20/bin/node: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by /__e/node20/bin/node)
      /__e/node20/bin/node: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by /__e/node20/bin/node)
      
      NO_CHANGELOG=ci
      NO_DOC=ci
      NO_TEST=ci
      8aff2ede
  3. Mar 12, 2024
    • Mergen Imeev's avatar
      box: fix DDL check for recovery · 0510ffa0
      Mergen Imeev authored
      
      Commit 71de4b2c ("box: fix schema downgrade replication") introduces
      check that decides when DDL is disabled if current schema is not equal
      to required schema. This patch adds a condition for DDL operations to be
      enabled during recovery, so new bootstrap snapshot can be properly
      generated.
      
      Follow-up #9049
      
      NO_DOC=bugfix
      NO_TEST=internal
      NO_CHANGELOG=internal
      
      Co-authored-by: default avatarVladimir Davydov <vdavydov@tarantool.org>
      0510ffa0
  4. Mar 11, 2024
    • Mergen Imeev's avatar
      config: introduce sharding.weight · 567cba8a
      Mergen Imeev authored
      Closes #9775
      
      @TarantoolBot document
      Title: The `sharding.weight` option
      
      The `sharding.weight` option can be set to facilitate rebalancing. The
      larger the weight of a replicaset, the more data it can store. This is a
      relative value, so a replicaset with a value N times larger than a value
      of the another replicaset can store N times more data. The default value
      is 1.
      567cba8a
    • Mergen Imeev's avatar
      config: set config status after "post_apply" phase · 1a5b8008
      Mergen Imeev authored
      Previously, the config status was set after the "apply" phase, and then
      set again after the "post_apply" phase. This can lead to a situation
      where the status becomes "ready" after the "apply" phase and changes to
      "check_errors" or "check_warnings" after the "post_apply" phase.
      Because of this, it was possible that config:reload() may be called from
      a role or an app even if though the config loading is not finished.
      
      Note that due to this change, the "startup_in_progress" and
      "reload_in_progress" statuses are now expanded to include the
      "post_apply" phase.
      
      Also note that the status still changes before the "extras.post_apply"
      stage.
      
      Needed for https://github.com/tarantool/tarantool-ee/issues/643
      
      NO_DOC=internal
      1a5b8008
    • Georgiy Lebedev's avatar
      lua: increase error serialization verbosity · cc7af2eb
      Georgiy Lebedev authored
      Currently, the error object's `__serialize` metamethod and the Lua
      serializer only display the `message` field omitting all other potentially
      useful fields.
      
      Let's call the error object's `__serialize` metamethod from the Lua
      serializer and call `error:unpack` from the `__serialize` metamethod to
      display all other error object fields. This will transparently allow to
      display the whole error stack (i.e., the cause chain).
      
      Let's make the error object's  `__tostring` metamethod return the `message`
      field followed by a whitespace and the rest of the fields encoded to JSON.
      Let's print the error stack (i.e., the cause chain) on separate lines.
      
      Since this change may potentially break existing users, let's add a new
      `box_error_serialize_verbose` option to `compat` to retain old behavior,
      and disable the new behaviour by default. Let's also retain the old
      behaviour for the MsgPack serializers unconditionally.
      
      Closes #9105
      
      @TarantoolBot document
      Title: Document increased error serialization verbosity
      Product: Tarantool
      Since: 3.1
      Root documents: https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_error/
      and https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_error/error
      and https://tarantool.io/compat/box_error_serialize_verbose
      
      [Link to the design document](https://www.notion.so/tarantool/Error-subsystem-improvements-90faa0a4714b4143abaf8bed2c10b2fc?pvs=4#072087684e094ea28cba88002236178a)
      
      Please add a new https://tarantool.io/compat/box_error_serialize_verbose
      page for the `box_error_serialize_verbose` compatibility option.
      cc7af2eb
    • Georgiy Lebedev's avatar
      lua: always try to serialize extensions using `luaL_convertfield` · 5e13b02a
      Georgiy Lebedev authored
      Currently, we delegate the work of serializing extensions to serializers in
      case of known extensions. In case of unknown extensions we try to convert
      them from Lua using the serialization and string conversion metamethods.
      
      However, there are cases where we would prefer to do the serialization in
      Lua instead of delegating to serializers. Let's always try to serialize
      extensions first using Lua via `luaL_convertfield`, and, if it fails, or
      the conversion returns an extension again, fallback to the serializers.
      
      Needed for #9105
      
      NO_CHANGELOG=<refactoring>
      NO_DOC=<refactoring>
      NO_TEST=<refactoring>
      5e13b02a
    • Alexander Turenko's avatar
      lyaml: fix alias serialization · 610f5fb7
      Alexander Turenko authored
      
      The #8350 was introduced by the commit b42302f5 ("lua-yaml: enable
      aliasing for objects returned by __serialize") so the patch is
      effectively reversed.
      
      The idea is to call all object __serialize methods recursively before
      finding references. The new serialization pass stores the mapping from
      the original object to the serialized representation.
      
      After this, the reference analysis pass and the encoding pass use this
      mapping to replace original objects with the serialized representation.
      
      As result, the reference analysis has a complete information about
      objects and no references are missed.
      
      Closes #8350
      Closes #8310
      Closes #8321
      
      NO_DOC=bugfix
      
      Co-authored-by: default avatarNikolay Shirokovskiy <nshirokovskiy@tarantool.org>
      610f5fb7
  5. Mar 07, 2024
  6. Mar 05, 2024
    • Andrey Saranchin's avatar
      test: cover port implementations with unit tests · f90f5390
      Andrey Saranchin authored
      The commit introduces new `unit/port.cc` test that covers almost all
      port implementations and almost all port methods. This test was
      intended as a testing point for future port changes.
      
      Implementations `port_sql` and `port_vdbemem` and method  `dump_vdbemem`
      are not tested because I don't know much about the sql subsystem. For
      the same reason, I didn't tested `port_dump_msgpack_with_context`.
      Method `dump_msgpack_16` is not actually supported, but it is
      still used for compatibility with very old connectors. The problem is I
      found a bug in `port_c_dump_msgpack_16` while writing the test, and we
      don't want to fix it - probably, we will get rid of this method in
      future. Method `dump_plain` is not tested because it requires functions
      from `console.lua` file - it is easier to test `console.push` from Lua
      then loading the Lua file in unit test.
      
      The file has .cc extension because the test requires user_cache
      susbystem, which has init and free methods available only from C++
      source files.
      
      NO_CHANGELOG=test
      NO_DOC=test
      f90f5390
    • Andrey Saranchin's avatar
      test: include lua headers in extern "C" scope · 2af8611b
      Andrey Saranchin authored
      Lua headers don't have C++ guards which means all Lua symbols are
      mangled as C++ ones when the files included in a C++ source file,
      but then the linker fails because all Lua functions are exported
      with C mangling. Let's include lua headers in extern "C" scope to
      allow to use "lua_test_utils.h" in unit tests written in C++.
      
      NO_CHANGELOG=test
      NO_DOC=test
      2af8611b
    • Andrey Saranchin's avatar
      port_c: drop assertion in port_c_dump_lua method · 60cbfbe4
      Andrey Saranchin authored
      The method actually supports all modes of dump to Lua, but the assertion
      checks that mp_object mode is never used - the commit drops the
      assertion.
      
      This mode is tested with a tuple constraint taking raw args. Along the
      way, some test cases are enabled back because the bug that caused them
      to be disabled has been fixed.
      
      NO_CHANGELOG=internal
      NO_DOC=internal
      60cbfbe4
    • Nikolay Shirokovskiy's avatar
      error: hide redundant fields of box.error.unpack() · ee087472
      Nikolay Shirokovskiy authored
      Closes #9101
      
      @TarantoolBot document
      Title: hide redundant fields of box.error.unpack()
      
      Do not show redundant fields of box.error.unpack(). These are `base_type`,
      `custom_type` and `code` if the latter is 0.
      
      New behaviour is available if `box_error_unpack_type_and_code` compat
      option is 'new'. Default value is 'old` currently.
      
      (The https://tarantool.io/compat/box_error_unpack_type_and_code is
      to be added.)
      ee087472
  7. Mar 04, 2024
    • Vladimir Davydov's avatar
      Remove broken symlink debian/tarantool.service · d7490305
      Vladimir Davydov authored
      Leads nowhere after commit 216b6243 ("tools: remove tarantoolctl
      utility").
      
      NO_DOC=cleanup
      NO_TEST=cleanup
      NO_CHANGELOG=cleanup
      d7490305
    • Ilya Verbin's avatar
      core: do not limit the length of an error message by 512 bytes · c8da06ca
      Ilya Verbin authored
      Now the error message is allocated by `malloc' if it doesn't fit into the
      static buffer.
      
      Closes #4975
      
      NO_DOC=bugfix
      c8da06ca
    • Magomed Kostoev's avatar
      perf: add a BPS tree benchmark · 80797d25
      Magomed Kostoev authored
      The benchmark tests the tree build, key search, insert and delete
      operations performance. The latter are tested both including and
      excluding the tree reballancing overhead.
      
      A very simple allocator had been introduced to mitigate the memory
      management overhead and noise.
      
      The benchmark functions are templated. This allows to test multiple
      tree configurations using the same benchmarking routines.
      
      The simplest tree configuration is used, though it's possible to add
      new configurations to the benchmark. Example on how to create a tree
      similar to the one used by the memtx index is shown in the appendix A.
      
      Closes #9630
      
      NO_DOC=new benchmark
      NO_TEST=new benchmark
      NO_CHANGELOG=new benchmark
      
      APPENDIX A: Adding a new tree configuration to the benchmark.
      
      ```C
      /* Instantiate the tree. */
      
      #define tree_s128_EXTENT_SIZE 16 * 1024
      #define tree_s128_elem_t struct tree_s128_elem
      #define tree_s128_key_t struct tree_s128_key
      
      struct tree_s128_elem {
      	void *tuple; /* Unused. */
      	int64_t hint;
      
      	tree_s128_elem() = default;
      	tree_s128_elem(int64_t hint) : hint(hint) {}
      };
      
      struct tree_s128_key {
      	void *key; /* Unused. */
      	uint32_t part_count; /* Unused. */
      	int64_t hint;
      
      	tree_s128_key(int64_t hint) : hint(hint) {}
      };
      
      #define BPS_TREE_NAME tree_s128_t
      #define BPS_TREE_BLOCK_SIZE 512
      #define BPS_TREE_EXTENT_SIZE tree_s128_EXTENT_SIZE
      #define BPS_TREE_IS_IDENTICAL(a, b) ((a).hint == (b).hint)
      #define BPS_TREE_COMPARE(a, b, arg) ((a).hint - (b).hint)
      #define BPS_TREE_COMPARE_KEY(a, b, arg) ((a).hint - (b).hint)
      #define bps_tree_elem_t tree_s128_elem_t
      #define bps_tree_key_t tree_s128_key_t
      #define bps_tree_arg_t int
      #include "salad/bps_tree.h"
      #undef BPS_TREE_NAME
      #undef BPS_TREE_BLOCK_SIZE
      #undef BPS_TREE_EXTENT_SIZE
      #undef BPS_TREE_IS_IDENTICAL
      #undef BPS_TREE_COMPARE
      #undef BPS_TREE_COMPARE_KEY
      #undef bps_tree_elem_t
      #undef bps_tree_key_t
      #undef bps_tree_arg_t
      
      /** Add the new tree to the `generate_benchmarks` macro. */
      
      #define generate_benchmarks(generator, func, arg) \
      	generator(tree_i64, func, arg); \
      	generator(tree_s128, func, arg) /* < The line to be added. */
      
      /** Create the new tree class. */
      
      CREATE_TREE_CLASS(tree_i64);
      CREATE_TREE_CLASS(tree_s128); /* < The line to be added. */
      ```
      80797d25
  8. Mar 01, 2024
    • Alexander Turenko's avatar
      config: add ordered dictionary (internal module) · f267af24
      Alexander Turenko authored
      In development of the configuration module we met several cases, when an
      order of appearance of some items is as important as a constant time
      access using a key.
      
      This commit adds a collection that serves such a need. It is to be used
      internally in the src/box/lua/config code.
      
      The module is inspired by Python's collections.OrderedDict. See the
      description in the module code for details.
      
      NO_DOC=the module is for internal use, at least for now
      NO_CHANGELOG=see NO_DOC
      f267af24
  9. Feb 29, 2024
    • Alexander Turenko's avatar
      ci: use Ubuntu Jammy for checkpatch · 21a779e1
      Alexander Turenko authored
      It brings newer codespell version: 2.1.0. Ubuntu Focal offers 1.16.0.
      
      Fixes tarantool/checkpatch#70
      
      NO_DOC=CI adjustment
      NO_CHANGELOG=see NO_DOC
      NO_TEST=see NO_DOC
      21a779e1
    • Yaroslav Lobankov's avatar
      cmake: add libresolv to static dependency list · 8f6bc366
      Yaroslav Lobankov authored
      If we run a static build with ASAN enabled via Clang 16, the build will
      fail unless `libresolv` is in the white list of static dependencies.
      It looks like it is a peculiarity of Clang 16 and higher.
      
      Fixes #9740
      
      NO_DOC=build
      NO_TEST=build
      NO_CHANGELOG=build
      8f6bc366
    • Igor Munkin's avatar
      test: remove LuaJIT-related CLI tests · 137e9156
      Igor Munkin authored
      There are two reasons for this changeset:
      
      * The positive one: Tarantool supports -b and -j options to use LuaJIT
        modules since the commit bf8b76a4
        ("lua: proxy -j and -b flags"), so the related tests from lua-Harness
        suite can be partially (since -O option is still not implemented in
        Tarantool) enabled.
      
      * The negative one: Tarantool diff-based tests for CLI interfaces are
        hard to maintain, if any change occurs in LuaJIT modules, since the
        aforementioned tests implement dumb comparison of the output, produced
        by the current CLI version against the expected one, managed by the
        .result file. Hence, to rule the tests related to the LuaJIT CLI
        interface in a more convenient way, the corresponding tests should be
        moved from the tests in the Tarantool repository to the tests in the
        LuaJIT repository.
      
      The recent LuaJIT bump landed to the master in the scope of commit
      0dcf6759 ("luajit: bump new version")
      enables the nice checks implemented in the lua-Harness suite; this patch
      removes the barely maintainable diff-based tests from this repository.
      
      Follows up #5541
      
      NO_DOC=test
      NO_CHANGELOG=test
      137e9156
  10. Feb 28, 2024
    • Sergey Kaplun's avatar
      luajit: bump new version · 0dcf6759
      Sergey Kaplun authored
      * cmake: introduce AddTestLib macro
      * test: prepare lauxilarily libs for LuaJIT-tests
      * test: separate LuaJIT helpers from ffi_util.inc
      * test: enable <ffi_arith_ptr.lua> in LuaJIT-tests
      * test: enable <ffi_bitfield.lua> in LuaJIT-tests
      * test: enable <ffi_call.lua> in LuaJIT-tests
      * test: enable <ffi_callback.lua> in LuaJIT-tests
      * test: enable <ffi_const.lua> in LuaJIT-tests
      * test: enable <ffi_convert.lua> in LuaJIT-tests
      * test: enable <ffi_enum.lua> in LuaJIT-tests
      * test: enable <ffi_gcstep_recursive.lua>
      * test: enable <ffi_jit_arith.lua> in LuaJIT-tests
      * test: enable <ffi_jit_call.lua> in LuaJIT-tests
      * test: enable <ffi_jit_conv.lua> in LuaJIT-tests
      * test: enable <ffi_lex_number.lua> in LuaJIT-tests
      * test: enable <ffi_metatype.lua> in LuaJIT-tests
      * test: enable <ffi_new.lua> in LuaJIT-tests
      * test: enable <ffi_parse_array.lua> in LuaJIT-tests
      * test: enable <ffi_parse_basic.lua> in LuaJIT-tests
      * test: enable <ffi_parse_cdef.lua> in LuaJIT-tests
      * test: enable <ffi_parse_struct.lua> LuaJIT test
      * test: enable <ffi_tabov.lua> LuaJIT test
      * test: enable <lightud.lua> LuaJIT test
      * test: enable <api_call.lua> LuaJIT test
      * test: enable <catch_wrap.lua> LuaJIT test
      * test: enable <catch_cpp.lua> LuaJIT test
      * test: introduce routine to build error message
      * test: enable CLI-related lua-Harness tests back
      
      Closes #7834
      Part of #9398
      Follows up #5541
      
      NO_DOC=LuaJIT submodule bump
      NO_TEST=LuaJIT submodule bump
      NO_CHANGELOG=add new tests
      0dcf6759
    • Vladimir Davydov's avatar
      alter: move format compatibility check to space_check_format · d9e0b58a
      Vladimir Davydov authored
      We assume that if the new format can store tuples matching the old
      format, we can update the space format without calling the engine
      check_format callback. This is true for both memtx and vinyl but
      not for memcs (EE), which doesn't support extending field types
      (e.g. changing int16 to int32).
      
      Let's call the engine check_format callback unconditionally and let
      it decide whether tuple format checking can be skipped.
      
      Needed for tarantool/tarantool-ee#694
      
      NO_DOC=refactoring
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      d9e0b58a
  11. Feb 26, 2024
    • Nikolay Shirokovskiy's avatar
      build/lua: add TEST_BUILD define/tarantool.build flag · 94d28138
      Nikolay Shirokovskiy authored
      In the commit 22d507d5 ("iproto: don't hang on uncancellable iproto
      request") we used TEST_BUILD define which is absent, we only have
      a CMake build option with such name. Let's add a define too.
      
      While at it let's also show this flag in the `tarantool.build` table.
      
      Follow-up #8423
      
      @TarantoolBot document
      Title: new tarantool.build.test_build flag
      
      It is `true` if `TEST_BUILD` build option is set and `false` otherwise.
      94d28138
  12. Feb 22, 2024
    • Nikolay Shirokovskiy's avatar
      iproto: fix assertion on dropping of a new connection · a12998a5
      Nikolay Shirokovskiy authored
      We need to handle case of dropping new connection. When
      net_send_greeting() is executed the connection can be closed due to
      iproto_drop_connections() call.
      
      Note that in the test the Tarantool crashes for another reason. Due to
      access after sleep to the connection that is destroyed so its memory is
      poisoned. Yet we visit net_send_greeting() too in the test with patch so
      original issue is verified too. We also need to test that such
      a connection is closed. This will be done in EE version.
      
      Closes #9717
      
      NO_DOC=bugfix
      a12998a5
  13. Feb 21, 2024
    • Ilya Verbin's avatar
      box/lua: implement inheritance of error payload fields · d592f26d
      Ilya Verbin authored
      Suppose an error has a cause with some payload fields, for example:
        local e1 = box.error.new{'e1', foo = 'bar'} -- cause
        local e2 = box.error.new{'e2', prev = e1}   -- effect
      
      Now it is possible to access cause payload fields via e2 directly:
        e2.foo -- 'bar'
      
      While looking for a payload field with a given name, we always stop at
      the topmost (closest to the effect) field. If there's a field with the
      same name deeper in the stack it is masked.
      
      Closes #9106
      
      @TarantoolBot document
      Title: Document inheritance of error payload fields
      Product: Tarantool
      Since: 3.1
      Root document: https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_error/error_object/
      
      [Link to the design document](https://www.notion.so/tarantool/Error-subsystem-improvements-90faa0a4714b4143abaf8bed2c10b2fc?pvs=4#c080fe2ac28b46c8b0eda7234a8852ce)
      d592f26d
    • Ilya Verbin's avatar
      box/lua: don't mask error object methods by payload fields · 709938a9
      Ilya Verbin authored
      With commit eb2c6a4a ("box/lua: allow to set custom error payload
      fields") it is possible to add a field named "raise", but it will
      override the `error_object:raise()' method. Forbid it. The user can
      still access masked payload fields through the `unpack()' method.
      
      NO_DOC=unreleased
      NO_CHANGELOG=unreleased
      709938a9
    • Nikolay Shirokovskiy's avatar
      misc: cleanup usage of pthread_cancel · 0e86fbde
      Nikolay Shirokovskiy authored
      At last we can drop usage of pthread_cancel and associated functions.
      And remove related leak suppressions.
      
      Let's keep memory protection disabling under ASAN. Otherwise
      leak sanitizer may misbehave on Tarantool panic as below.
      
      ```
        #   Tracer caught signal 11: addr=0x705236d1e000 pc=0x57b7605b10d0 sp=0x705232a00ca0\
        #   ==1022907==LeakSanitizer has encountered a fatal error.\
        #   ==1022907==HINT: For debugging, try setting environment variable LSAN_OPTIONS=verbosity=1:log_threads=1\
        #   ==1022907==HINT: LeakSanitizer does not work under ptrace (strace, gdb, etc)",
      ```
      
      Let's also add missing pipe/endpoint destroy in wal while at it.
      
      Close #8423
      
      NO_CHANGELOG=internal
      NO_DOC=internal
      0e86fbde
    • Nikolay Shirokovskiy's avatar
      fiber: allow creating system fibers during shutdown · a83d5e3c
      Nikolay Shirokovskiy authored
      In the commit d40ce0fa ("core: disable fibers creation after
      shutdown started") we disable creation of new fibers in the process of
      shutdown. This may cause subsystem shutdown hanging.
      
      The thing is we need fiber pool working during shutdown. For example
      vinyl engine uses it through "tx" endpoint. Fibers in the pool are
      finished after idle timeout. So we may have a situation when there is no
      idle fibers in the pool and we cannot create a new one.
      
      Part of #8423
      
      NO_CHANGELOG=bugfix for unreleased version
      NO_DOC=bugfix for unreleased version
      a83d5e3c
Loading