Skip to content
Snippets Groups Projects
  1. Jun 18, 2024
    • Sergey Kaplun's avatar
      perf: add aggregator helper for bench statistics · 95257919
      Sergey Kaplun authored
      This patch adds a helper script to aggregate the benchmark results from
      JSON files to the format parsable by the InfluxDB line protocol [1].
      
      All JSON files from the <perf/output> directory are benchmark results
      and aggregated into the <perf/output/summary.txt> file that can be
      posted to the InfluxDB. The results are aggregated via the new target
      test-perf-aggregate, which is run only if some JSON files with results
      are missed.
      
      [1]: https://docs.influxdata.com/influxdb/v2/reference/syntax/line-protocol/
      
      NO_DOC=perf test
      NO_CHANGELOG=perf test
      NO_TEST=perf test
      95257919
    • Sergey Kaplun's avatar
      perf: move compare.lua to the tools directory · 02690a24
      Sergey Kaplun authored
      This file can be used to compare the results of Lua benchmarks. Since it
      has a general purpose, it is moved to the <perf/tools> directory.
      
      NO_DOC=perf test
      NO_CHANGELOG=perf test
      NO_TEST=perf test
      02690a24
    • Sergey Kaplun's avatar
      perf: save perf results for the benchmarks · 2c60a941
      Sergey Kaplun authored
      This patch saves the output of the performance tests in the JSON format
      to be processed later. The corresponding directory is added to the
      <.gitignore>.
      
      NO_DOC=perf test
      NO_CHANGELOG=perf test
      NO_TEST=perf test
      2c60a941
    • Sergey Kaplun's avatar
      perf: provide items_per_second metric in bps_tree · cd2f4838
      Sergey Kaplun authored
      This patch considers the number of iterations as the number of items
      proceeded by the corresponding benchmark, so it may be used for the
      `items_per_second` counter.
      
      NO_DOC=perf test
      NO_CHANGELOG=perf test
      NO_TEST=perf test
      cd2f4838
    • Sergey Kaplun's avatar
      perf: standardize gh-7089-vclock-copy benchmark · ccb7a649
      Sergey Kaplun authored
      The output now contains items per second without the mean time in
      seconds. The number of iterations is reduced to 40 to avoid running the
      test too long. The `wal_mode` option (default is "none") is set via
      command line flags, as far as the number of nodes (default is 10). Also,
      the master nodes are set up via the `popen()` command without using any
      Makefile.
      
      Also, two new options are introduced:
      * The `--output` option allows you to specify the output file.
      * The `--output_format` option means the format for the printed output.
        The default is "console". It prints items proceeded per second to the
        stdout. The "json" format contains all the information about the
        benchmark in a format similar to Google Benchmark's.
      
      Usually, these options should be used together to dump machine-readable
      results for the benchmarks.
      
      NO_DOC=perf test
      NO_CHANGELOG=perf test
      NO_TEST=perf test
      ccb7a649
    • Sergey Kaplun's avatar
      perf: rename subtests in column_scan · 72dd9324
      Sergey Kaplun authored
      This patch renames subtests in column scan to avoid the usage of `,`
      (the separator) in the tag name for the InfluxDB report.
      
      NO_DOC=perf test
      NO_CHANGELOG=perf test
      NO_TEST=perf test
      72dd9324
    • Sergey Kaplun's avatar
      perf: standardize column_scan benchmark · cd54f50a
      Sergey Kaplun authored
      The output now contains items per second instead of time in seconds.
      
      Also, two new options are introduced:
      * The `--output` option allows you to specify the output file.
      * The `--output_format` option means the format for the printed output.
        The default is "console". It prints rows proceeded per second to the
        stdout. The "json" format contains all the information about the
        benchmark in a format similar to Google Benchmark's.
      
      Usually, these options should be used together to dump machine-readable
      results for the benchmarks.
      
      NO_DOC=perf test
      NO_CHANGELOG=perf test
      NO_TEST=perf test
      cd54f50a
    • Sergey Kaplun's avatar
      perf: standardize box_select benchmark · 7c51884d
      Sergey Kaplun authored
      The output now contains items per second instead of time in nanoseconds.
      
      Also, two new options are introduced:
      * The `--output` option allows you to specify the output file.
      * The `--output_format` option means the format for the printed output.
        The default is "console". It just prints the number of iterations
        proceeded per second to the stdout. The "json" format contains all the
        information about the benchmark in a format similar to Google
        Benchmark's.
      
      Usually, these options should be used together to dump machine-readable
      results for the benchmarks.
      
      NO_DOC=perf test
      NO_CHANGELOG=perf test
      NO_TEST=perf test
      7c51884d
    • Sergey Kaplun's avatar
      perf: standardize uri_escape_unescape benchmark · 0b1ecf66
      Sergey Kaplun authored
      Two new options are introduced:
      * The `--output` option allows you to specify the output file.
      * The `--output_format` option means the format for the printed output.
        The default is "console". It just prints the amount of iterations
        proceeded per second to the stdout. The "json" format contains all the
        information about the benchmark in a format similar to Google
        Benchmark's.
      
      Usually, these options should be used together to dump machine-readable
      results for the benchmarks.
      
      NO_DOC=perf test
      NO_CHANGELOG=perf test
      NO_TEST=perf test
      0b1ecf66
    • Sergey Kaplun's avatar
      perf: clarify comments in the uri_escape_unescape · b337ff1e
      Sergey Kaplun authored
      This patch rewrites comments regarding JIT compiler options to avoid
      confusion.
      
      NO_DOC=perf test
      NO_CHANGELOG=perf test
      NO_TEST=perf test
      b337ff1e
    • Sergey Kaplun's avatar
      perf: standardize 1mops_write benchmark · a29becf4
      Sergey Kaplun authored
      The (not commented) output now contains average items per second instead
      of peak speed.
      
      Also, two new options are introduced:
      * The `--output` option allows you to specify the output file.
      * The `--output_format` option means the format for the printed output.
        The default is "console". It just prints inserts per second value to
        the stdout. The "json" format contains all the information about the
        benchmark in a format similar to Google Benchmark's.
      
      Usually, these options should be used together to dump machine-readable
      results for the benchmarks.
      
      The test can still be run standalone to be usable alongside Tarantool's
      repository.
      
      NO_DOC=perf test
      NO_CHANGELOG=perf test
      NO_TEST=perf test
      a29becf4
    • Sergey Kaplun's avatar
      perf: introduce benchmark.lua helper module · 3110ef9a
      Sergey Kaplun authored
      This module helps to aggregate various subbenchmark runs and dump them
      either to stdout or to the specified file. Also, it allows you to output
      results in the JSON format.
      
      Usually, these options should be used together to dump machine-readable
      results for the benchmarks.
      
      Also, set the `LUA_PATH` environment variable for the Lua benchmarks to
      make the introduced module requirable.
      
      NO_DOC=perf test
      NO_CHANGELOG=perf test
      NO_TEST=perf test
      3110ef9a
    • Sergey Kaplun's avatar
      gitignore: add perf/lua/Makefile · 435906db
      Sergey Kaplun authored
      This is a follow-up for the commit
      49d9a874 ("perf: add targets for running
      Lua performance tests"), where the corresponding perf test target is
      introduced.
      
      NO_DOC=perf test
      NO_CHANGELOG=perf test
      NO_TEST=perf test
      435906db
    • Alexander Turenko's avatar
      config: use vshard-ee if available · 29519c71
      Alexander Turenko authored
      The new closed-source `vshard-ee` module was recently introduced. It is
      based on the open-source `vshard` module and, as far as I know, provides
      the same API.
      
      Let's configure `vshard-ee` in the same way as `vshard` if sharding is
      enabled in tarantool's configuration.
      
      Prefer `vshard-ee` if both are available.
      
      Fixes https://github.com/tarantool/tarantool-ee/issues/815
      
      @TarantoolBot document
      Title: config: vshard-ee is now supported
      
      The declarative configuration supports `vshard-ee` in addition to
      `vshard` since Tarantool 3.1.1 and 3.2+.
      
      `vshard` is mentioned in the documentation at least [here][1]. All such
      places should be updated to mention both `vshard-ee` and `vshard`.
      
      [1]: https://www.tarantool.io/en/doc/latest/reference/configuration/configuration_reference/#sharding
      29519c71
    • Alexander Turenko's avatar
      loaders: add require_first function (internal) · 3abd4f96
      Alexander Turenko authored
      Usage example:
      
      ```lua
      local loaders = require('internal.loaders')
      local vshard = loaders.require_first('vshard-ee', 'vshard')
      ```
      
      The function is for internal use.
      
      It would be nice to have something of this kind in the public API, but
      I'm not going to solve it within this patch.
      
      Needed for https://github.com/tarantool/tarantool-ee/issues/815
      
      NO_DOC=no public API changes
      NO_CHANGELOG=see NO_DOC
      3abd4f96
  2. Jun 17, 2024
    • DerekBum's avatar
      box: feature `tuple:format` to get a format of a tuple · 6d5f1db5
      DerekBum authored
      This patch adds `tuple:format()` method to get a format
      of a tuple.
      
      Closes #10005
      
      @TarantoolBot document
      Title: New `format` method for `box.tuple`
      Product: Tarantool
      Since: 3.2
      
      The `tuple:format` method returns a format of a tuple.
      6d5f1db5
    • Sergey Bronnikov's avatar
      test/fuzz: speedup string serialization · 3d97334f
      Sergey Bronnikov authored
      - clamp before cleaning string because cleaning is not cheap
        (O(n), where max n is equal to kMaxStrLength)
      - call cleaning for identifiers only, there is no sense to
        cleaning string literals
      - replace symbols disallowed by Lua grammar in indentifier's
        names with '_'
      
      The patch saves 16 sec on 145k samples (401 sec before the patch
      and 385 sec after the patch). It is actually not so much, but it
      is about 2.5 min per hour.
      
      NO_CHANGELOG=testing
      NO_DOC=testing
      3d97334f
  3. Jun 14, 2024
  4. Jun 13, 2024
    • Nikolay Shirokovskiy's avatar
      ci: add a workflow to check for entrypoint tags · c06d0d14
      Nikolay Shirokovskiy authored
      Check check-entrypoint.sh comment for explanation of what entrypoint tag
      is. The workflow fails if current branch does not have a most recent
      entrypoint tag that it should have.
      
      Part of #8319
      
      NO_TEST=ci
      NO_CHANGELOG=ci
      NO_DOC=ci
      c06d0d14
    • Vladimir Davydov's avatar
      vinyl: fix gc vs vylog race leading to duplicate record · 9d3859b2
      Vladimir Davydov authored
      Vinyl run files aren't always deleted immediately after compaction,
      because we need to keep run files corresponding to checkpoints for
      backups. Such run files are deleted by the garbage collection procedure,
      which performs the following steps:
      
       1. Loads information about all run files from the last vylog file.
       2. For each loaded run record that is marked as dropped:
          a. Tries to remove the run files.
          b. On success, writes a "forget" record for the dropped run,
             which will make vylog purge the run record on the next
             vylog rotation (checkpoint).
      
      (see `vinyl_engine_collect_garbage()`)
      
      The garbage collection procedure writes the "forget" records
      asynchronously using `vy_log_tx_try_commit()`, see `vy_gc_run()`.
      This procedure can be successfully executed during vylog rotation,
      because it doesn't take the vylog latch. It simply appends records
      to a memory buffer which is flushed either on the next synchronous
      vylog write or vylog recovery.
      
      The problem is that the garbage collection isn't necessarily loads
      the latest vylog file because the vylog file may be rotated between
      it calls `vy_log_signature()` and `vy_recovery_new()`. This may
      result in a "forget" record written twice to the same vylog file
      for the same run file, as follows:
      
        1. GC loads last vylog N
        2. GC starts removing dropped run files.
        3. CHECKPOINT starts vylog rotation.
        4. CHECKPOINT loads vylog N.
        5. GC writes a "forget" record for run A to the buffer.
        6. GC is completed.
        7. GC is restarted.
        8. GC finds that the last vylog is N and blocks on the vylog latch
           trying to load it.
        9. CHECKPOINT saves vylog M (M > N).
       10. GC loads vylog N. This triggers flushing the forget record for
           run A to vylog M (not to vylog N), because vylog M is the last
           vylog at this point of time.
       11. GC starts removing dropped run files.
       12. GC writes a "forget" record for run A to the buffer again,
           because in vylog N it's still marked as dropped and not forgotten.
           (The previous "forget" record was written to vylog M).
       13. Now we have two "forget" records for run A in vylog M.
      
      Such duplicate run records aren't tolerated by the vylog recovery
      procedure, resulting in a permanent error on the next checkpoint:
      
      ```
      ER_INVALID_VYLOG_FILE: Invalid VYLOG file: Run XXXX forgotten but not registered
      ```
      
      To fix this issue, we move `vy_log_signature()` under the vylog latch
      to `vy_recovery_new()`. This makes sure that GC will see vylog records
      that it's written during the previous execution.
      
      Catching this race in a function test would require a bunch of ugly
      error injections so let's assume that it'll be tested by fuzzing.
      
      Closes #10128
      
      NO_DOC=bug fix
      NO_TEST=tested manually with fuzzer
      9d3859b2
    • Vladimir Davydov's avatar
      tuple: don't use offset_slot_cache in vinyl threads · 19d1f1cc
      Vladimir Davydov authored
      `key_part::offset_slot_cache` and `key_part::format_epoch` are used for
      speeding up tuple field lookup in `tuple_field_raw_by_part()`. These
      structure members are accessed and updated without any locks, assuming
      this code is executed exclusively in the tx thread. However, this isn't
      necessarily true because we also perform tuple field lookups in vinyl
      read threads. Apparently, this can result in unexpected races and bugs,
      for example:
      
      ```
        #1  0x590be9f7eb6d in crash_collect+256
        #2  0x590be9f7f5a9 in crash_signal_cb+100
        #3  0x72b111642520 in __sigaction+80
        #4  0x590bea385e3c in load_u32+35
        #5  0x590bea231eba in field_map_get_offset+46
        #6  0x590bea23242a in tuple_field_raw_by_path+417
        #7  0x590bea23282b in tuple_field_raw_by_part+203
        #8  0x590bea23288c in tuple_field_by_part+91
        #9  0x590bea24cd2d in unsigned long tuple_hint<(field_type)5, false, false>(tuple*, key_def*)+103
        #10 0x590be9d4fba3 in tuple_hint+40
        #11 0x590be9d50acf in vy_stmt_hint+178
        #12 0x590be9d53531 in vy_page_stmt+168
        #13 0x590be9d535ea in vy_page_find_key+142
        #14 0x590be9d545e6 in vy_page_read_cb+210
        #15 0x590be9f94ef0 in cbus_call_perform+44
        #16 0x590be9f94eae in cmsg_deliver+52
        #17 0x590be9f9583e in cbus_process+100
        #18 0x590be9f958a5 in cbus_loop+28
        #19 0x590be9d512da in vy_run_reader_f+381
        #20 0x590be9cb4147 in fiber_cxx_invoke(int (*)(__va_list_tag*), __va_list_tag*)+34
        #21 0x590be9f8b697 in fiber_loop+219
        #22 0x590bea374bb6 in coro_init+120
      ```
      
      Fix this by skipping this optimization for threads other than tx.
      
      No test is added because reproducing this race is tricky. Ideally, bugs
      like this one should be caught by fuzzing tests or thread sanitizers.
      
      Closes #10123
      
      NO_DOC=bug fix
      NO_TEST=tested manually with fuzzer
      19d1f1cc
    • Vladimir Davydov's avatar
      vinyl: fix cache iterator skipping tuples in read view · 7b72080d
      Vladimir Davydov authored
      The tuple cache doesn't store older tuple versions so if a reader is
      in a read view, it must skip tuples that are newer than the read view,
      see `vy_cache_iterator_stmt_is_visible()`. A reader must also ignore
      cached intervals if any of the tuples used as a boundary is invisible
      from the read view, see `vy_cache_iterator_skip_to_read_view()`.
      There's a bug in `vy_cache_iterator_restore()` because of which such
      an interval may be returned to the reader: when we step backwards
      from the last returned tuple we consider only one of the boundaries.
      As a result, if the other boundary is invisible from the read view,
      the reader will assume there's nothing in the index between the
      boundaries and skip reading older sources (memory, disk). Fix this by
      always checking if the other boundary is visible.
      
      Closes #10109
      
      NO_DOC=bug fix
      7b72080d
    • Vladimir Davydov's avatar
      vinyl: fix run iterator skipping tuples following non-terminal statement · 72763f94
      Vladimir Davydov authored
      If a run iterator is positioned at a non-terminal statement (UPSERT or
      UPDATE), `vy_run_iterator_next()` will iterate over older statements
      with the same key using `vy_run_iterator_next_lsn()` to build the key
      history. While doing so, it may reach the end of the run file (if the
      current key is the last in the run). This would stop iteration
      permanently, which is apparently wrong for reverse iterators (LE or LT):
      if this happens the run iterator won't return any keys preceding the
      last one in the run file. Fix this by removing `vy_run_iterator_stop()`
      from `vy_run_iterator_next_lsn()`.
      
      Part of #10109
      
      NO_DOC=bug fix
      NO_CHANGELOG=next commit
      72763f94
  5. Jun 10, 2024
    • Georgiy Lebedev's avatar
      box: refactor synchro quorum update on deletion from `_cluster` space · 9b63ced3
      Georgiy Lebedev authored
      For symmetry with the update of the synchronous replication quorum on
      insertion into the `_cluster` space, let's reuse the
      `on_replace_cluster_update_quorum` on_commit trigger.
      
      Follows-up #10087
      
      NO_CHANGELOG=<refactoring>
      NO_DOC=<refactoring>
      NO_TEST=<refactoring>
      9b63ced3
    • Georgiy Lebedev's avatar
      box: update synchro quorum in on_commit trigger instead of on_replace · 29d1c0fa
      Georgiy Lebedev authored
      Currently, we update the synchronous replication quorum from the
      `on_replace` trigger of the `_cluster` space when registering a new
      replica. However, during the join process, the replica cannot ack its own
      insertion into the `_cluster` space. In the scope of #9723, we are going to
      enable synchronous replication for most of the system spaces, including the
      `_cluster` space. There are several problems with this:
      
      1. Joining a replica to a 1-member cluster without manual changing of
      quorum won't work: it is impossible to commit the insertion into the
      `_cluster` space with only 1 node, since the quorum will equal to 2 right
      after the insertion.
      
      2. Joining a replica to a 3-member cluster may fail: the quorum will become
      equal to 3 right after the insertion, the newly joined replica cannot ACK
      its own insertion into the `_cluster` space — if one out of original 3
      nodes fails, then reconfiguration will fail.
      
      Generally speaking, it will be impossible to join a new replica to the
      cluster, if a quorum, which includes the newly added replica (which cannot
      ACK), cannot be gathered.
      
      To solve these problems, let's update the quorum in the `on_commit`
      trigger. This way we’ll be able to insert a node regardless of the current
      configuration. This somewhat contradicts with the Raft specification, which
      requires application of all configuration changes in the `on_replace`
      trigger (i.e., as soon as they are persisted in the WAL, without quorum
      confirmation), but still forbids several reconfigurations at the same time.
      
      Closes #10087
      
      NO_DOC=<no special documentation page devoted to cluster reconfiguration>
      29d1c0fa
    • Georgiy Lebedev's avatar
      box: add `confirm_lag` field to `box.info.synchro.queue` · 42c4c34b
      Georgiy Lebedev authored
      Let's add a lag confirmation field to the limbo, and expose information
      about the time the latest successfully confirmed entry waited for quorum.
      
      Part of #9918
      
      @TarantoolBot document
      Title: New `age` and `confirm_lag` fields in `box.info.synchro.queue`
      Product: Tarantool
      Since: 3.2
      Root documents: https://www.tarantool.io/ru/doc/latest/reference/reference_lua/box_info/synchro/
      
      The `age` field shows the time that the oldest entry currently present in
      the queue has spent waiting for quorum, while the `confirm_lag` field shows
      the time that the latest successfully confirmed entry waited for the
      quorum to gather.
      42c4c34b
    • Georgiy Lebedev's avatar
      box: add `age` field to `box.info.synchro.queue` · bded0061
      Georgiy Lebedev authored
      Let's add an insertion timestamp to the limbo entry, and expose information
      about the time the current oldest limbo entry has spent in the queue
      waiting for the quorum.
      
      Part of #9918
      
      NO_CHANGELOG=<in the final patch>
      NO_DOC=<in the final patch>
      bded0061
    • Nikolay Shirokovskiy's avatar
      error: finish changes to several C modules to use box.error · 530aa82d
      Nikolay Shirokovskiy authored
      We already do some steps to use box.error in these C modules. Let's
      finish it to make a clear distinction between C modules that are
      switched to box.error and that are not.
      
      Follow-up #9996
      
      NO_CHANGELOG=internal
      NO_DOC=internal
      530aa82d
    • Vladimir Davydov's avatar
      vinyl: fix crash on invalid upsert · dd0ac814
      Vladimir Davydov authored
      `vy_apply_result_does_cross_pk()` must be called after the new tuple
      format is validated, otherwise it may crash in case the new tuple has
      fields conflicting with the primary key definition.
      
      While we are at it, fix the operation cursor (`ups_ops`) not advanced
      on this kind of error. This resulted in skipped `upsert` statements
      following an invalid `upsert` statement in a transaction.
      
      Closes #10099
      
      NO_DOC=bug fix
      dd0ac814
  6. Jun 08, 2024
    • Yaroslav Lobankov's avatar
      test: bump test-run to new version · 32bcea7d
      Yaroslav Lobankov authored
      Bump test-run to new version with the following improvements:
      
      - Calculate parallel jobs based on available CPUs [1]
      - Bump luatest to 1.0.1-15 (--list-test-cases) [2]
      - luatest: detox test searching code [3]
      - luatest: allow to run test cases in parallel [4]
      
      [1] tarantool/test-run@182aa77
      [2] tarantool/test-run@1fbbf9a
      [3] tarantool/test-run@3b0ccd0
      [4] tarantool/test-run@dd00063
      
      NO_DOC=test
      NO_TEST=test
      NO_CHANGELOG=test
      32bcea7d
    • Yaroslav Lobankov's avatar
      ci: disable workaround for LuaJIT profiling tests on aarch64 runners · e64457d9
      Yaroslav Lobankov authored
      Disable workaround for LuaJIT profiling tests on aarch64 runners due to
      the following error:
      
          mount: /tmp/luajit-test-vardir: mount failed: Operation not permitted
      
      Looks like it happens because our aarch64 runners are LXD containers.
      
      NO_DOC=ci
      NO_TEST=ci
      NO_CHANGELOG=ci
      e64457d9
    • Yaroslav Lobankov's avatar
      Revert "ci: temporary disable aarch64 packaging job" · 655eefc6
      Yaroslav Lobankov authored
      This reverts commit ef3152cd.
      
      We have solved the issues with aarch64 runners, so we can enable back
      aarch64 jobs.
      
      NO_DOC=ci
      NO_TEST=ci
      NO_CHANGELOG=ci
      655eefc6
  7. Jun 07, 2024
    • Vladimir Davydov's avatar
      vinyl: fix crash on extending secondary key parts with primary · 9b817848
      Vladimir Davydov authored
      If a secondary index is altered in such a way that its key parts are
      extended with the primary key parts, rebuild isn't required because
      `cmp_def` doesn't change, see `vinyl_index_def_change_requires_rebuild`.
      In this case `vinyl_index_update_def` will try to update `key_def` and
      `cmp_def` in-place with `key_def_copy`. This will lead to a crash
      because the number of parts in the new `key_def` is greater.
      
      We can't use `key_def_dup` instead of `key_def_copy` there because
      there may be read iterators using the old `key_def` by pointer so
      there's no other option but to force rebuild in this case.
      
      The bug was introduced in commit 64817066 ("vinyl: use update_def
      index method to update vy_lsm on ddl").
      
      Closes #10095
      
      NO_DOC=bug fix
      9b817848
    • Dmitry Oboukhov's avatar
      key_def: Introduce `__len` metamethod · 90f33049
      Dmitry Oboukhov authored
      The metamethod is a way to key_def length introspection.
      
      Closes #10111
      
      @TarantoolBot document
      Title: key_def length introspection
      
      To check key_def length (parts count) there is a standard lua operator
      `#` (`__len` metamethod).
      
      Example:
      
      ```lua
      function is_full_pkey(space, key)
          return #space.index[0].parts == #key
      end
      ```
      90f33049
    • Vladimir Davydov's avatar
      vinyl: fix crash in index drop if there is DML request reading from it · bde28f0f
      Vladimir Davydov authored
      A DML request (insert, replace, update) can yield while reading from
      the disk in order to check unique constraints. In the meantime the index
      can be dropped. The DML request can't crash in this case thanks to
      commit d3e12369 ("vinyl: abort affected transactions when space is
      removed from cache"), but the DDL operation can because:
       - It unreferences the index in `alter_space_commit`, which may result
         in dropping the LSM tree with `vy_lsm_delete`.
       - `vy_lsm_delete` may yield in `vy_range_tree_free_cb` while waiting
         for disk readers to complete.
       - Yielding in commit triggers isn't allowed (crashes).
      
      We already fixed a similar issue when `index.get` crashed if raced
      with index drop, see commit 75f03a50 ("vinyl: fix crash if space is
      dropped while space.get is reading from it"). Let's fix this issue in
      the same way - by taking a reference to the LSM tree while checking
      unique constraints. To do that it's enough to move `vy_lsm_ref` from
      `vinyl_index_get` to `vy_get`.
      
      Also, let's replace `vy_slice_wait_pinned` with an assertion checking
      that the slice pin count is 0 in `vy_range_tree_free_cb` because
      `vy_lsm_delete` must not yield.
      
      Closes #10094
      
      NO_DOC=bug fix
      bde28f0f
    • Vladimir Davydov's avatar
      tuple: fix crash on hashing tuple with double fields · bc0daf99
      Vladimir Davydov authored
      `tuple_hash_field()` doesn't advance the MsgPack cursor after hashing
      a tuple field with the type `double`, which can result in crashes both
      in memtx (while inserting a tuple into a hash index) and in vinyl
      (while writing a bloom filter on dump or compaction).
      
      The bug was introduced by commit 51af059c ("box: compare and hash
      msgpack value of double key field as double").
      
      Closes #10090
      
      NO_DOC=bug fix
      bc0daf99
  8. Jun 06, 2024
    • Alexander Turenko's avatar
      odict: fix ffi.new('void *') as a key · 822aedfe
      Alexander Turenko authored
      The problem is found by @ochaton.
      
      NO_DOC=bugfix
      NO_CHANGELOG=not a public API
      822aedfe
    • Nikolay Shirokovskiy's avatar
      test: bump test-run to new version · 97a801e1
      Nikolay Shirokovskiy authored
      Bump test-run to new version with the following improvements:
      
      - Bump luatest to 1.0.1-14-gdfee2f3 [1]
      - Adjust test result report width to terminal size [2]
      - dispatcher: lift pipe buffer size restriction [3]
      - flake8: fix E721 do not compare types [4]
      
      [1] tarantool/test-run@84ebae5
      [2] tarantool/test-run@1724211
      [3] tarantool/test-run@81259c4
      [4] tarantool/test-run@1037299
      
      We also have to fix several tests that check that script with luatest
      assertions have empty stderr output. test-run brings Luatest which
      logs assertions at 'info' level.
      
      Note that gh_8433_raft_is_candidate_test is different. Original
      assertion involves logging huge tables that have somewhere closed
      sockets inside. And 'socket.__tostring' currently raises error for
      closed sockets.
      
      We need to fix gh_6819_iproto_watch_not_implemented_test also to
      account error created on loading `luatest` on `server:exec` after
      the commit "Add trace check for error assertions".
      
      Part of #9914
      
      NO_DOC=internal
      NO_TEST=internal
      NO_CHANGELOG=internal
      97a801e1
    • Nikolay Shirokovskiy's avatar
      console: check error trace where specified · f48d2967
      Nikolay Shirokovskiy authored
      In scope of the #9914 issue we are setting error trace for API to the
      caller frame. Let's leverage existing diff tests to check error trace.
      Just check error trace when error is raised when evaluating expression
      in console which is used in diff tests.
      
      The check is done for test build only and only for Lua modules specified
      in `tarantool._internal.trace_check_is_required`.
      
      Part of #9914
      
      NO_TEST=internal
      NO_CHANGELOG=internal
      NO_DOC=internal
      f48d2967
    • Nikolay Shirokovskiy's avatar
      error: set trace of caller for API in Lua for several modules · 4175ab05
      Nikolay Shirokovskiy authored
      Why these modules? Initially in the scope of #9914 we only want
      to fix trace for `schema.lua` but there is an issue. In the next
      patch we changing `console.lua` so that for existing diff test the
      trace is checked (for specified modules).
      
      In that patch we add a wrapper function around evaluated expression. So
      that argument checking functions like `luaL_checklstring` start to refer
      wrapper's ``fn`` in error instead of ``?``. We decided drop the usage of
      such checkers in code covered by diff tests. Once we touch a module in
      the scope this change we also fix all non box errors to box ones with
      proper level.
      
      Part of #9914
      
      NO_CHANGELOG=incomplete
      NO_DOC=incomplete
      4175ab05
Loading