Skip to content
Snippets Groups Projects
  1. Nov 23, 2022
    • Vladimir Davydov's avatar
      vinyl: fix tuple missing in cache after reading rolled backed DELETE · e00f16e4
      Vladimir Davydov authored
      The read iterator skips DELETE statements. If a skipped DELETE statement
      was read from the transaction write set, the read iterator breaks the
      current cache chain by clearing vy_read_iterator::last_cached, because
      the deleted tuple may actually be present at a lower level so adding
      a gap there until the transaction is committed would be incorrect, see
      commit dd926790 ("vinyl: fix a bug in adding of a cache chain").
      
      The problem is vy_cache_add() assumes that if last_cached is NULL
      the tuple added to the cache must be the first tuple that meets the
      iteration criteria and sets the cache node boundary level accordingly.
      This may lead to the previous tuple being erroneously skipped later
      in case the transaction that attempted to delete it is rolled back.
      
      Fix this issue by passing the flag indicating if the current tuple is
      the first result of the iteration explicitly to vy_cache_add().
      
      Closes #7947
      
      NO_DOC=bug fix
      e00f16e4
    • Nikolay Shirokovskiy's avatar
      misc: get rid of fiber_gc · 19abfd2a
      Nikolay Shirokovskiy authored
      As it breaks sane usage of region as a data stack:
      
      	size_t region_svp = region_used(&fiber()->gc);
      	/* some allocation on fiber gc and usage of allocated memory. */
      	region_truncate(&fiber()->gc, region_svp);
      
      If in the above snippet one calls a function that in turn calls
      `fiber_gc` then the snippet code may have use-after-free and later UB
      on truncation.
      
      For this reason let's get read of fiber_gc. However we need to make sure
      we won't introduce leaks this way. So before actually removing
      fiber_gc we make it perform leak check instead and only after fixing
      all the leaks the fiber_gc was removed.
      
      In order to find the leak easily the backtrace of the first fiber gc
      allocation that is not truncated is saved and then reported.
      
      In order to catch leaks that are not triggered by the current test suit
      and to prevent introducing leaks in future patches the leak check is
      added on fiber exit/recycle and for long living system fibers on every loop
      iteration.
      
      Leak check in release build is on but without leak backtrace info by
      default for performance reasons. Backtrace can be provided by using
      `fiber.leak_backtrace_enable()` knob before starting leaking fiber.
      
      Regularly leaks are only reported in log but it will not help to
      catch errors when running test suits so build option ABORT_ON_LEAK
      is added. When it is on we abort on leak. This option is turned off
      for all builds that used in CI.
      
      Closes #5665
      
      NO_CHANGELOG=internal
      NO_DOC=internal
      19abfd2a
    • Nikolay Shirokovskiy's avatar
      space: use txn region for request in space_execute_dml · 0792565b
      Nikolay Shirokovskiy authored
      Currently in space_execute_dml we have some txn related objects
      allocated on fiber region. Use txn region as in other places.
      
      NO_DOC=internal
      NO_CHANGELOG=internal
      NO_TEST=internal
      0792565b
    • Nikolay Shirokovskiy's avatar
      core: make backtrace_snprint usable with tt_static_buf() · d01049ec
      Nikolay Shirokovskiy authored
      Currently `backtrace_snprint ` indirectly uses `tt_static_buf()` by
      itself. As a result its callers cannot use `tt_static_buf()`. With
      large enough backtrace stack size buffer passed to `backtrace_snprint`
      will be overwritten inside `backtrace_frame_resolve` call.
      
      Part of #5665
      
      NO_DOC=internal
      NO_CHANGELOG=internal
      NO_TEST=internal
      d01049ec
    • Igor Munkin's avatar
      luajit: bump new version · a9e655d2
      Igor Munkin authored
      * Ensure correct stack top for OOM error message.
      * x86/x64: Check for jcc when using xor r,r in emit_loadi().
      * Save trace recorder state around VM event call.
      * Fix io.close() error message.
      * Fix io.close().
      * Cleanup math function compilation and fix inconsistencies.
      
      Closes #3840
      Closes #6782
      Part of #7230
      
      NO_DOC=LuaJIT submodule bump
      NO_TEST=LuaJIT submodule bump
      a9e655d2
  2. Nov 22, 2022
  3. Nov 21, 2022
    • Serge Petrenko's avatar
      qsync: fix local writes failing on non-empty synchro queue · fb5a990f
      Serge Petrenko authored
      Local spaces can be written to on any replica, even on a read-only one.
      This makes sense, because local space data isn't replicated, so it can't
      lead to a conflict or violate consistency anyhow.
      
      However, when used together with synchronous replication, local spaces
      can't be written to by anyone but the synchro queue owner:
      ```
      tarantool> box.info.synchro.queue.len
      ---
      - 1
      ...
      tarantool> box.space.loc:replace{2}
      ---
      - error: Found uncommitted sync transactions from other instance with id 1
      ...
      ```
      Fix this and allow to put transactions touching local spaces to the
      synchro queue even if it is claimed by someone else.
      
      Note, we can't let local transactions bypass the synchro queue completely.
      This would lead to consistency loss in a case when synchro queue
      contains a transaction [sync_row, local_row], and another transcation
      [local_row], probably based on the sync transaction, bypasses the limbo.
      
      Closes #7592
      
      NO_DOC=bugfix
      fb5a990f
    • Serge Petrenko's avatar
      txn: refactor adding transactions to the synchro queue · 1c08633b
      Serge Petrenko authored
      txn_commit() and txn_commit_try_async() share the common logic of
      determining if a transaction should go to the synchronous transaction
      queue and then putting the transaction there.
      
      Factor the common places out to a helper.
      
      Part-of #7592
      
      NO_DOC=refactoring
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      1c08633b
    • Yan Shtunder's avatar
      replication: invalid recovery from xlog · f53fde16
      Yan Shtunder authored
      If you shut down the replica and delete all xlog files on it, and it
      reconnect to the master, may occur the restore error. Because there are
      intermediate xlog files between the snap on the replica and the last
      xlog on the master. When restoring xlog files on the replica, it can be
      occurred that prev_signature < signature and this will lead to the crash
      of the master.
      
      Closes #5158
      
      NO_DOC=bugfix
      f53fde16
  4. Nov 20, 2022
  5. Nov 18, 2022
    • Ilya Grishnov's avatar
      tarantoolctl: add man of flag --format for cat · b7ed783a
      Ilya Grishnov authored
      Added a description for the --format flag
      of the tarantoolctl cat command.
      
      Fixes #7099
      
      NO_DOC=bugfix
      NO_TEST=help message fix
      b7ed783a
    • Sergey Ostanevich's avatar
      flaky: follow-up for qsync_basic test · e27ddf70
      Sergey Ostanevich authored
      Two more places where replica didn't wait until data is replicated.
      
      Follow-up tarantool/tarantool-qa#274
      
      NO_CHANGELOG=test fix
      NO_DOC=test fix
      e27ddf70
    • Ilya Verbin's avatar
      box: fix rollback of read-only transaction statements · d94eb857
      Ilya Verbin authored
      Existence of txn_commit_ro_stmt assumes there is txn_rollback_ro_stmt,
      but it does not exist. Instead, currently we use txn_rollback_stmt, which
      has nothing to do with 'ro' statements, and will just rollback the
      currently running normal statement.
      
      As an example, consider box_index_iterator. It calls txn_begin_ro_stmt,
      which does not produce any artefacts in an existing `struct txn`. But in
      case of the iterator creation fail it calls txn_rollback_stmt, which will
      rollback the currently being executed 'rw' statement.
      
      Drop txn_commit_ro_stmt and introduce txn_end_ro_stmt, which is called
      regardless of 'ro' statement result.
      
      NO_DOC=bugfix
      
      Closes #5501
      d94eb857
    • Georgiy Lebedev's avatar
      box: export `box_schema_version` to public API and Lua · 9a5188b1
      Georgiy Lebedev authored
      `box_schema_version` symbol is currently exposed via `exports`, but it is
      not part of the public API: export it to public API and Lua.
      
      Retain `box.internal.schema_version` for backward compatibility and add
      deprecation warning issued only once.
      
      Closes #7904
      
      @TarantoolBot document
      Title: export `box_schema_version` to public API and Lua
      `box_schema_version`, which returns the server's current monotonic schema
      version, is now part of Tarantool public API, and is also accessible from
      Lua:
      ```lua
      box.info.schema_version
      -- 81
      ```
      
      Schema version is a number that is designed for simple detection of changes
      in the database schema. It is guaranteed that if space/index/tuple API of
      database is changed (any space/index is added/deleted or any name of
      space/index/field is changed) - this value will grow. Another (weak)
      guarantee is that the value usually remains the same if there were no
      changes in system spaces (with id < 512), so usually it is changed rather
      seldom. The value may grow when any other change in system spaces takes
      place, but the exact behavior is unspecified and an application should not
      rely on it. Using of this value inside of a transaction that makes such
      changes is unspecified either.
      
      IPROTO_SCHEMA_VERSION section of IPROTO response is set to this number.
      9a5188b1
    • Georgiy Lebedev's avatar
      box: change schema version type to `uint64_t` · 0b876b76
      Georgiy Lebedev authored
      The requirement of the schema version is that it monotonically grows: in
      order to protect from wrapping, change its type and the type of everything
      depending on it to `uint64_t`.
      
      Needed for #7904
      
      NO_CHANGELOG=enhancement
      NO_DOC=enhancement
      NO_TEST=enhancement
      0b876b76
  6. Nov 17, 2022
    • Andrey Saranchin's avatar
      net.box: add pagination options to select · c4b8debe
      Andrey Saranchin authored
      The patch introduces after and fetch_pos options to net.box select.
      New options are equivalents of the same options of index:select.
      Behavior of `is_async`, `buffer` and `skip_header` options will be
      described in documentation. If server does not support pagination,
      select with any pagination option will throw an error.
      
      Closes #7637
      
      NO_CHANGELOG=see later commits
      NO_DOC=see later commits
      c4b8debe
    • Andrey Saranchin's avatar
      iproto: add pagination options to iproto · 948e5cdc
      Andrey Saranchin authored
      The patch adds new iproto keys needed for pagination and extends
      tx_process_select, used by IPROTO. IPROTO and NETBOX_IPROTO versions
      are updated, iproto feature pagination is introduced, new keys are:
      
      0x2e - IPROTO_AFTER_POSITION - start iteration after passed
      iterator position. It has type MP_STR.
      
      0x2f - IPROTO_AFTER_TUPLE - start iteration after passed tuple.
      It has type MP_ARRAY.
      
      0x1f - IPROTO_FETCH_POSITION - send position of last fetched tuple
      in response. It has type MP_BOOL.
      
      0x35 - IPROTO_POSITION - iterator position, sent in response if
      IPROTO_FETCH_POSITION is true. It has type MP_STR.
      
      Part of #7637
      
      NO_CHANGELOG=see later commits
      NO_DOC=see later commits
      948e5cdc
  7. Nov 15, 2022
    • Ilya Verbin's avatar
      coro: update sp before saving registers to a stack frame · 215630e6
      Ilya Verbin authored
      Currently AArch64 version of coro_transfer stores x19-x30 and d8-d15
      registers to the stack, but only after that it updates the stack pointer.
      If a SIGALRM signal is delivered during the execution of coro_transfer,
      the signal handler will use the stack starting from current sp, thus
      corrupting the saved registers.
      
      Fix this by updating the stack pointer at the beginning of coro_transfer.
      x2 register is still required, because `str sp, [x0, #0]` is invalid in
      the A64 instruction set.
      
      Closes #7484
      Closes #7523
      
      NO_DOC=bugfix
      NO_TEST=Hard to create a stable reproducer,
              mostly covered by existing tests.
      215630e6
  8. Nov 11, 2022
    • Sergey Bronnikov's avatar
      lua: use https protocol in a crash report message · bab289cd
      Sergey Bronnikov authored
      NO_DOC=fix protocol in link
      NO_TEST=fix protocol in link
      NO_CHANGELOG=fix protocol in link
      bab289cd
    • Vladimir Davydov's avatar
      test: fix flaky box-luatest/gh_7917_log_row_on_recovery_error_test · 3d3e9dea
      Vladimir Davydov authored
      The test fails with:
      
        master | 2022-11-11 09:03:32.093 [4128822] main/103/default.lua F>
        can't initialize storage: unlink, called on fd 30, aka unix/:(socket),
        peer of unix/:(socket): Address already in use
      
      Looks like it happens, because both test cases share the socket path.
      The fix is the same as in commit 3f86cd04 ("test: fix flaky
      'test_ignore_with_force_recovery'") - use different socket paths.
      
      Follow-up commit b2dab5f4 ("memtx: log bad row on snapshot recovery
      error").
      
      NO_DOC=test fix
      NO_CHANGELOG=test fix
      3d3e9dea
    • Igor Munkin's avatar
      luajit: bump new version · 2acac734
      Igor Munkin authored
      * ci: add workflow for legacy CMake GNU Make build
      * build: fix build with the original Makefile
      * ci: drop integration for macOS with disabled GC64
      * ci: add 'self-hosted' tag to runs-on
      * ci: use Ninja generator in CI workflows
      * ci: use CMAKE_EXTRA_PARAMS in LuaJIT integration
      * test: replace result variable in MakeLuaPath.cmake
      * ci: merge Linux and macOS workflows
      * ci: merge x86_64 and ARM64 workflows
      * ci: remove arch prefix for macOS M1 workflow
      * ci: remove excess parallel level setup
      * ci: use out of source build in GitHub Actions
      * test: fix tarantool suite for out of source build
      * test: introduce MakeLuaPath.cmake helper
      * test: introduce utils.profilename helper
      
      NO_DOC=LuaJIT submodule bump
      NO_TEST=LuaJIT submodule bum
      NO_CHANGELOG=ci
      2acac734
  9. Nov 10, 2022
    • Serge Petrenko's avatar
      relay: fix loss of one of the two consecutive heartbeats · 2cf411b0
      Serge Petrenko authored
      When replica heartbeat is read while another heartbeat is en route, it's
      delivery is delayed for a full replication_timeout.
      
      This can be seen in replication/qsync_basic.test.lua occasional hangs on
      these lines:
      ```
      --
      -- gh-5100: replica should send ACKs for sync transactions after
      -- WAL write immediately, not waiting for replication timeout or
      -- a CONFIRM.
      --
      -- on replica:
      box.cfg{replication_timeout = 1000, replication_synchro_timeout = 1000}
      test_run:switch('default')
      box.cfg{replication_timeout = 1000, replication_synchro_timeout = 1000}
      <factored-out>
      -- Now commit something sync. It should return immediately even
      -- though the replication timeout is huge.
      box.space.sync:replace{4}
      
      ```
      
      Change that so a pending heartbeat is sent immediately upon status
      message return from tx thread.
      
      Closes #7869
      
      NO_TEST=hard to test
      NO_DOC=bugfix
      NO_CHANGELOG=not user-visible
      2cf411b0
    • Igor Munkin's avatar
      ci: add 'self-hosted' tag to runs-on section · a8b95d09
      Igor Munkin authored
      
      Fun fact: our self-hosted macOS runner has the same name as the one
      provided by GitHub. Hence sometimes when no self-hosted runners are
      available, the public GitHub one is chosen.
      
      This patch enforces LuaJIT integration workflow to use only self-hosted
      runner by explicitly specifying this in runs-on section.
      
      NO_DOC=ci
      NO_TEST=ci
      NO_CHANGELOG=ci
      
      Reviewed-by: default avatarYaroslav Lobankov <y.lobankov@tarantool.org>
      Signed-off-by: default avatarIgor Munkin <imun@tarantool.org>
      a8b95d09
    • Vladimir Davydov's avatar
      memtx: log bad row on snapshot recovery error · b2dab5f4
      Vladimir Davydov authored
      We log bad row on xlog recovery error. We should log bad row on snapshot
      recovery error ase well to ease debugging.
      
      Closes #7917
      
      NO_DOC=bug fix
      b2dab5f4
    • Gleb Kashkin's avatar
      lua/fio: clearer error msg for pread() · 22ecf87a
      Gleb Kashkin authored
      fh:pread() will raise a clear error on wrong arguments.
      
      Closes #4963
      
      NO_DOC=bugfix
      NO_CHANGELOG=bugfix
      22ecf87a
  10. Nov 09, 2022
  11. Nov 08, 2022
    • Andrey Saranchin's avatar
      box: rework iterator_position entity · a62e14a0
      Andrey Saranchin authored
      There is a big caveat in current implementation of position - it is
      represented as a string with unprintable chars in Lua - if user will
      need to save it to another database or pass to another client,
      unprintable chars can be affected. That is why we decided to redesign
      position entity - now it is just a key with MP_ARRAY header, encoded to
      base64 format.
      
      NO_CHANGELOG=redesign of unreleased feature
      NO_DOC=later
      
      Part of #7639
      a62e14a0
    • Andrey Saranchin's avatar
      box: return no position on empty page when offset is used · 04bc54ed
      Andrey Saranchin authored
      When pagination is used with offset and returns no tuples while several
      tuples were actually skipped by offset, iterator has non-NULL position,
      that is why select returns non-empty position. Let's check if resulting
      tuples were actually found before return position.
      
      NO_CHANGELOG=bugfix for unreleased feature
      NO_DOC=bugfix
      
      Part of #7639
      04bc54ed
    • Vladimir Davydov's avatar
      build: add EXTRA_API_HEADERS variable · a80b77f7
      Vladimir Davydov authored
      The module API header (module.h) is generated automatically by
      extracting everything between '\cond public' and '\endcond public'
      from headers listed in the api_headers CMake variable. We're
      planning to extend the module API in Tarantool EE. To achieve that,
      this commit includes all files listed in the new CMake variable
      EXTRA_API_HEADERS into api_headers.
      
      Needed for https://github.com/tarantool/tarantool-ee/issues/265
      
      NO_DOC=build
      NO_TEST=build
      NO_CHANGELOG=build
      a80b77f7
  12. Nov 07, 2022
    • Georgiy Lebedev's avatar
      test: add test for replacement of absolute paths in diagnostics (#7808) · ffb17a55
      Georgiy Lebedev authored
      Since this feature is compiler-dependent, we need to skip the test if the
      server was build with a compiler that does not support the
      `-fmacro-prefix-map` flag.
      
      Follow-up #7808
      
      NO_CHANGELOG=test
      NO_DOC=test
      NO_TEST=test
      ffb17a55
    • Georgiy Lebedev's avatar
      build: store compiler ID and version in `COMPILER_INFO` · aec0393e
      Georgiy Lebedev authored
      Currently, `tarantool.build.compiler` stores the `CMAKE_C_COMPILER` and
      `CMAKE_CXX_COMPILER` strings from CMake, which are basically paths to the
      compiler used for build, and are usually set to `/usr/bin/cc` and
      `/usr/bin/c++` accordingly, which does not yield any useful information:
      instead, set it to `${CMAKE_C_COMPILER_ID}-${CMAKE_C_COMPILER_VERSION}`,
      assuming the same compiler is used for building C and C++.
      
      Closes #7888
      
      @TarantoolBot document
      Title: change of information shown in compiler information
      Compiler information provided by `tarantool --version` and
      `tarantool.build.compiler` now show
      `${CMAKE_C_COMPILER_ID}-${CMAKE_C_COMPILER_VERSION}` instead of paths to C
      and C++ compilers used to build tarantool, for instance:
      
      ```console
      tarantool> tarantool.build.compiler
      
      ---
      - Clang-14.0.0.14000029
      ...
      
      tarantool> tarantool.build.compiler
      
      ---
      - GNU-12.2.0
      ...
      ```
      aec0393e
    • Georgiy Lebedev's avatar
      build: revert usage of relative paths in debugging information · 41c7db41
      Georgiy Lebedev authored
      The `-Wa,--debug-prefix-map` compiler flag breaks GNU-based LTO, and also
      we cannot reliably test this feature.
      
      Follow-up 256da010
      
      NO_CHANGELOG=bugfix
      NO_DOC=bugfix
      NO_TEST=bugfix
      41c7db41
    • Mergen Imeev's avatar
      box: rework index_def_is_valid() · 5df76ade
      Mergen Imeev authored
      This patch renames index_def_is_valid() to index_def_check() and makes
      it return 0 or -1 because that function sets a diag.
      
      NO_DOC=refactoring
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      5df76ade
Loading