Skip to content
Snippets Groups Projects
  1. Mar 31, 2023
  2. Mar 30, 2023
    • Nikolay Shirokovskiy's avatar
      prbuf: remove dead code · 9fcafbd1
      Nikolay Shirokovskiy authored
      Remove parts that used before flightrec reader API is added.
      
      - fix test_max_record_size case of prbuf unit test to use reader from
        file
      - drop prbuf reader from buffer in memory
      - drop prbuf Lua FFI interface
      
      Follow up: https://github.com/tarantool/tarantool-ee/issues/319
      
      NO_DOC=internal
      NO_CHANGELOG=internal
      9fcafbd1
    • Nikolay Shirokovskiy's avatar
      prbuf: fix unaligned memory access in reader · 73e59094
      Nikolay Shirokovskiy authored
      Found by EE CI in release asan in flightrec test which uses prbuf.
      Change prbuf test so that the issue is tested in CE where the prbuf code
      resides.
      
      Follow-up https://github.com/tarantool/tarantool-ee/issues/319
      
      NO_DOC=bug fix
      NO_CHANGELOG=unreleased bug fix
      73e59094
    • Vladimir Davydov's avatar
      memtx: introduce read view statistics · a75f4b7e
      Vladimir Davydov authored
      Closes #8501
      
      @TarantoolBot document
      Title: Document memtx read view statistics
      
      New entries have been added to `box.stat.memtx()` output:
      
      ```
      tarantool> box.stat.memtx().data
      ---
      - garbage: 0
        total: 24986
        read_view: 0
      ...
      
      tarantool> box.stat.memtx().index
      ---
      - read_view: 0
        total: 933888
      ...
      ```
      
      `data` shows how much memory is allocated for memtx tuples:
       - `data.total` - total amount of memory allocated for data tuples.
         This includes `data.read_view` and `data.garbage` plus tuples that
         are actually stored in memtx spaces.
       - `data.read_view` - memory held for read views.
       - `data.garbage` - memory that is unused and scheduled to be freed
         (freed lazily on memory allocation).
      
      `index` shows how much memory is allocated for memtx index extents:
       - `index.total` - total amount of memory allocated for indexing data.
         This includes `index.read_view` plus memory used for indexing tuples
         that are actually stored in memtx spaces.
       - `index.read_view` - memory held for read views.
      
      All numbers are given in bytes.
      
      `data.read_view` and `index.read_view` include memory allocated both for
      system read views (snapshot, replication) and user read views (EE-only).
      They should be non-zero only if there are open read views. To list all
      open read views, use `box.read_view.list()`.
      a75f4b7e
  3. Mar 29, 2023
    • Andrey Saranchin's avatar
      read_view: introduce pagination methods · 1e02e050
      Andrey Saranchin authored
      The commit adds new read view methods needed for pagination. Also, the
      check that tuple is not nil is dropped for the sake of consistency - we
      will omit this check in read view because it is incomplete anyway and
      the error message looks fine without it.
      
      Part of tarantool/tarantool-ee#285
      
      NO_CHANGELOG=in EE
      NO_DOC=in EE
      1e02e050
    • Andrey Saranchin's avatar
      box: factor out iterator_position logics · 32fe9b17
      Andrey Saranchin authored
      Since we are going to implement pagination for read_view, we need to
      factor out iterator_position logics to avoid duplication.
      
      Part of tarantool/tarantool-ee#285
      
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      NO_DOC=refactoring
      32fe9b17
    • Andrey Saranchin's avatar
      memtx: validate only cmp_def parts in pagination · 275130ff
      Andrey Saranchin authored
      Currently, we check that tuple passed as position fits space format.
      However, for pagination purposes, it's enough to validate only parts of
      tuple that are used in cmp_def. And, it allows not to use space format -
      we will need it in read view. So the patch replaces tuple validation with
      validation of its cmp_def parts only.
      
      Closes #8511
      Part of tarantool/tarantool-ee#285
      
      NO_DOC=bugfix
      275130ff
    • Andrey Saranchin's avatar
      key_def: introduce tuple_validate_key_parts_raw helper · f8bb4ec4
      Andrey Saranchin authored
      We are going to validate only key parts of passed tuple in pagination.
      That is why the patch introduces helper that allows to do it with raw
      version of tuple.
      
      Part of #8511
      Part of tarantool/tarantool-ee#285
      
      NO_CHANGELOG=internal
      NO_DOC=internal
      f8bb4ec4
    • Nikolay Shirokovskiy's avatar
      misc: add parts for flightrec reader in EE · 39a96aa3
      Nikolay Shirokovskiy authored
      This includes:
      - Call flightrec Lua C initialization.
      - Stop exporting in public API flightrec configuration function. It
      is intended for private use.
      - Export iproto_key_translation for representing requests/response
      records.
      
      Part of https://github.com/tarantool/tarantool-ee/issues/319
      
      NO_TEST=preparation for EE changes
      NO_CHANGELOG=preparation for EE changes
      NO_DOC=preparation for EE changes
      39a96aa3
    • Nikolay Shirokovskiy's avatar
      say: introduce say_log_level_str · 84a2cf60
      Nikolay Shirokovskiy authored
      It is intended to be used in EE. As we introduce this function it is
      a good moment to drop level_to_char and level_to_string. They have too
      little functionality.
      
      Part of https://github.com/tarantool/tarantool-ee/issues/319
      
      NO_CHANGELOG=internal
      NO_DOC=internal
      84a2cf60
    • Nikolay Shirokovskiy's avatar
      prbuf: fix losing records on prepare on wrap · c387250a
      Nikolay Shirokovskiy authored
      There is an issue in prbuf_prepare on branch when we need to
      wrap and allocate space for the record starting from the beginning of
      the data area.
      
      In the process we set end offset to 0. This means empty buffer. So if
      application is crashed after such prepare but before commit buffer will
      have no records. This is a bug.
      
      But actually we don't have to reset end to 0 unless we preparing for
      very big record which will occupy almost all buffer. In this case there
      is really no records left after preparation. Otherwise if we don't
      change end offset buffer will be valid and records will be there.
      
      Part of https://github.com/tarantool/tarantool-ee/issues/319
      
      NO_DOC=bugfix
      NO_CHANGELOG=minor
      c387250a
    • Nikolay Shirokovskiy's avatar
      prbuf: add reader from file · c7ed03de
      Nikolay Shirokovskiy authored
      New prbuf reader API is intended to be used in flight recorder reader
      API implementation.
      
      Currently prbuf has API to read records memory buffer. It is used for
      testing purposes only. We aim to drop this reader eventually. This patch
      in particular switch prbuf unit test to use new reader API.
      
      This patch also cleanups prbuf unit test besides merely adding tests
      for new and missing cases. This includes:
      
      - Using structured test plan. Now test plan is not some number which
      updated after running the test. With structure it can be written down
      deliberately.
      - Buffer/payload sizes in main test are tuned to test all possible
      unused space at the end of the buffer cases.
      - Check actual number of records in buffer. Otherwise we may not notice
      having no records at all for example.
      - Factor out common parts to helper functions/tests.
      - Print actual object in tests where it may help tests debugging.
      
      Part of https://github.com/tarantool/tarantool-ee/issues/319
      
      NO_DOC=internal
      NO_CHANGELOG=internal
      c7ed03de
    • Nikolay Shirokovskiy's avatar
      core: add new FileFormatError · 48ed9c4d
      Nikolay Shirokovskiy authored
      Part of https://github.com/tarantool/tarantool-ee/issues/319
      
      NO_CHANGELOG=internal
      NO_DOC=internal
      48ed9c4d
    • Gleb Kashkin's avatar
      console: fix :endswith() err in tntctl connection · 796e4b5b
      Gleb Kashkin authored
      There used to be a rare error when failed to connect via tarantoolctl to
      listening cartridge console. It was caused by unclear
      console.local_print() contract. Starting from gh-7031 fix, the function
      assumed string-only arguments, while in some cases cdata error was
      passed.
      
      Now console.local_print() prints all non-string arguments as is, without
      modifying potential local_eos.
      
      Closes #8374
      
      NO_DOC=bugfix
      NO_TEST=very hard to test
      796e4b5b
  4. Mar 28, 2023
    • Sergey Bronnikov's avatar
      ci: build doxygen doc without full-ci label · 07d686dc
      Sergey Bronnikov authored
      Follows up #8194
      
      NO_CHANGELOG=ci
      NO_DOC=ci
      NO_TEST=ci
      07d686dc
    • Sergey Bronnikov's avatar
      doxygen: update config · 660b8633
      Sergey Bronnikov authored
      - remove obsoleted parameters
      - return non-zero exit code when warnings are found. Doxygen has an
        option that set exit code to non-zero on warnings, available in
        Doxygen 1.9.0+, see [1] and [2].
      
      1. https://github.com/doxygen/doxygen/issues/8023
      2. https://www.doxygen.nl/manual/config.html
      
      NO_CHANGELOG=doxygen config
      NO_DOC=doxygen config
      NO_TEST=doxygen config
      
      Follows up #8194
      660b8633
    • Sergey Bronnikov's avatar
      module api: fix formatting comments for Doxygen · 30be5017
      Sergey Bronnikov authored
      - remove < and > around function names to make them resolvable
      - place @sa and \sa to the new lines and remove round parenthesis around
      - add missed dots
      - added comments for box_tuple_upsert, box_tuple_update, luaT_pusherror
        etc.
      - replace \example tags with \code and \endcode, because \example
        requires a file name with example, when \code allows to place a code
        inline
      - comments for macros alignof and likely/unlikely looks a bit ugly,
        but I couldn't find a better way to resolve doxygen warning
      - remove dashes after @param
      - corrected comments for box_tuple_update() and box_tuple_upsert()
      
      Closes #8194
      
      NO_CHANGELOG=fix doxygen
      NO_DOC=fix doxygen
      NO_TEST=fix doxygen
      30be5017
    • Vladimir Davydov's avatar
      memtx: use MemtxAllocator stats for box.info.memory · bd4c6675
      Vladimir Davydov authored
      We need MemtxAllocator stats for reporting read view memory usage, see
      https://github.com/tarantool/tarantool-ee/issues/143. Let's also use
      them for reporting data memory usage in box.info.memory() for
      consistency and add a test.
      
      It looks more correct that using allocator stats for reporting data
      memory usage because box.info.memory() is supposed to show high level
      stats. For low level allocator stats we have box.slab.info().
      
      Note that a memtx tuple may be held by tuple_bless so we have to reset
      it by creating a new tuple in Lua before checking memory usage.
      
      NO_DOC=refactoring
      NO_CHANGELOG=refactoring
      bd4c6675
    • Vladimir Davydov's avatar
      memtx: add MemtxAllocator statistics · 88a38db9
      Vladimir Davydov authored
      We account three metrics:
      
       - used_total - total size of allocated memory
       - used_rv - size of memory held for read views
       - used_gc - size of memory freed on demand
      
      We'll need them to report memtx read view statistics.
      
      While we are at it, switch the test to TAP and drop the result file.
      
      Needed for https://github.com/tarantool/tarantool-ee/issues/143
      
      NO_DOC=internal
      NO_CHANGELOG=internal
      88a38db9
  5. Mar 27, 2023
  6. Mar 24, 2023
  7. Mar 23, 2023
  8. Mar 22, 2023
    • Yaroslav Lobankov's avatar
      test: bump test-run to new version · f05e683c
      Yaroslav Lobankov authored
      Bump test-run to new version with the following improvements:
      
      - Introduce flaky tests statistics [1]
      
      [1] tarantool/test-run@7729a4c
      
      Part of tarantool/tarantool-qa#299
      
      NO_DOC=testing stuff
      NO_TEST=testing stuff
      NO_CHANGELOG=testing stuff
      f05e683c
    • Serge Petrenko's avatar
      relay: send heartbeats on top of replication stream · ee49c51a
      Serge Petrenko authored
      There was a problem with the leader's relay continuing to ping the
      remote followers even when the leader's tx thread is hung. This tricked
      the followers into thinking the leader is alive and well, even though it
      couldn't serve any new requests.
      
      The problem was partially fixed by commit 56571d83 ("raft: make
      followers notice leader hang"): that commit made relay thread stop
      sending heartbeats in case tx thread is unresponsive.
      
      Up to now we didn't differentiate between heartbeats and data rows: the
      receipt of both was considered a sign the master is alive. So if some
      replicas are not up to date with the master, they will continue thinking
      it's alive until they are fully synced and notice there are no more
      heartbeats from it.
      
      In order to fix this, stop treating all data as heartbeats and start
      sending heartbeats on top of an active replication stream.
      
      Closes #7515
      
      NO_DOC=bugfix
      ee49c51a
    • Vladimir Davydov's avatar
      memtx: refactor statistics reporting · 89a60d82
      Vladimir Davydov authored
      `box.stat.memtx` is a table that contains the 'tx' function. This is
      confusing because other stat entries are callable: `box.stat.net()`,
      `box.stat.vinyl()`, `box.stat.sql()`.
      
      Let's make `box.stat.memtx` callable for consistency. The function
      returns a table with the only field 'tx'. Note, we can't drop
      `box.stat.memtx.tx()` without breaking backward compatibility so we now
      return `box.stat.memtx().tx` when it's called.
      
      Also, let's use `info_handler` instead of pushing statistics directly to
      Lua for better encapsulation.
      
      Needed for https://github.com/tarantool/tarantool-ee/issues/143
      Closes #8448
      
      NO_DOC=updated https://github.com/tarantool/doc/issues/2801
      89a60d82
  9. Mar 21, 2023
    • Sergey Bronnikov's avatar
      test: add initial corpus with Lua samples · 890eb224
      Sergey Bronnikov authored
      Corpus based on PUC Rio Lua tests imported from LuaJIT repository [1].
      
      1. https://github.com/tarantool/luajit/tree/tarantool/test/PUC-Rio-Lua-5.1-tests
      
      Follows up #4823
      
      NO_CHANGELOG=corpus
      NO_DOC=corpus
      NO_TEST=corpus
      890eb224
    • Dmitriy Nesterov's avatar
      test/fuzz: add grammar-based LuaJIT fuzzer · a287c853
      Dmitriy Nesterov authored
      Patch adds a LuaJIT fuzzer based on libprotobuf-mutator and LibFuzzer.
      Grammar is described via messages in protobuf format, serializer is
      applied to convert .proto format to string.
      
      For displaying generated code on the screen during fuzzing set
      the environment variable 'LPM_DUMP_NATIVE_INPUT'.
      
      For displaying error messages from lua functions set
      the environment variable 'LUA_FUZZER_VERBOSE'.
      
      Note: UndefinedBehaviourSanitizer is unsupported by LuaJIT (see #8473),
      so fuzzing test is disabled when CMake option ENABLE_UB_SANITIZER is
      passed.
      
      Closes #4823
      
      NO_DOC=<fuzzing testing of LuaJIT>
      NO_TEST=<fuzzing testing of LuaJIT>
      a287c853
    • Dmitriy Nesterov's avatar
      test/fuzz: add options for better fuzzing · 69f21e25
      Dmitriy Nesterov authored
      Added options for fuzzing and for getting more information
      on debugging.
      
      NO_CHANGELOG=<fuzzing options>
      NO_DOC=<fuzzing options>
      NO_TEST=<fuzzing options>
      69f21e25
    • Dmitriy Nesterov's avatar
      cmake: add dependencies for LuaJIT and SQL fuzzers · b11072a6
      Dmitriy Nesterov authored
      Added Google's 'libprotobuf-mutator' and 'protobuf' libraries
      for developing grammar-based LuaJIT and SQL fuzzers based on
      LibFuzzer.
      
      It is needed to build protobuf module from source because
      by default, the system-installed version of protobuf is used
      by libprotobuf-mutator, and this version can be too old.
      
      Part of #4823
      
      NO_CHANGELOG=<dependencies>
      NO_DOC=<dependencies>
      NO_TEST=<dependencies>
      b11072a6
    • Andrey Saranchin's avatar
      box: drop field max_id in space _schema · 5324d66f
      Andrey Saranchin authored
      Now we use _space:max() instead of max_id for space id generation, so
      it is not used anymore. The patch removes max_id from bootstrap snapshot,
      adds upgrade and downgrade scripts.
      
      Closes #5997
      
      @TarantoolBot document
      Title: Update the description of _schema
      Root document: https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_space/_schema/
      
      Since tarantool 2.11.1, there is no max_id field in space _schema.
      5324d66f
Loading