Skip to content
Snippets Groups Projects
  1. May 25, 2023
    • Yaroslav Lobankov's avatar
      metrics: bump to new version · 2057f6dc
      Yaroslav Lobankov authored
      Bump the metrics submodule to 1.0.0 version.
      
      NO_DOC=submodule bump
      NO_TEST=submodule bump
      NO_CHANGELOG=submodule bump
      
      (cherry picked from commit 8bbc73ce)
      Unverified
      2057f6dc
    • Yaroslav Lobankov's avatar
      test: bump test-run to new version · e93321d2
      Yaroslav Lobankov authored
      Bump test-run to new version with the following improvements:
      
      - lib: propagate test status 'skip' [1]
      - Show overall progress while running [2]
      - Follow test timeout for luatest [3]
      - Run luatest test by pattern [4]
      - Refactor command to run luatest test [5]
      - Bump luatest to 0.5.7-39-g89da427 [6]
      - consistent mode: fix worker's vardir calculation [7]
      
      [1] tarantool/test-run@6fbb7fd
      [2] tarantool/test-run@c5fa909
      [3] tarantool/test-run@f67d523
      [4] tarantool/test-run@264af05
      [5] tarantool/test-run@e19bb11
      [6] tarantool/test-run@3e74192
      [7] tarantool/test-run@aac77f5
      
      NO_DOC=testing stuff
      NO_TEST=testing stuff
      NO_CHANGELOG=testing stuff
      
      (cherry picked from commit 252865ce)
      Unverified
      e93321d2
    • Nikolay Shirokovskiy's avatar
      box: cleanup on tuple encoding failure · 622c6453
      Nikolay Shirokovskiy authored
      Currently on tuple encoding failure we raise Lua error. In many placess
      the error is not handled in Lua C code and we get misc leaks. Let's
      instead pass error as return value.
      
      Note that generally speaking encoding code can raise an error on OOM.
      Which will lead to leak again. Hopefully application will be killed by
      OOM killer instead. Other then that we expect no more errors in the
      code. If code calls a user defined callback then pcall is used (see
      lua_field_inspect_ucdata for example). So the turn from raising errors
      to returning error code seems the right direction.
      
      Closes #7939
      
      NO_DOC=bugfix
      
      (cherry picked from commit 9f9142d6)
      622c6453
    • Nikolay Shirokovskiy's avatar
      small: bump version · e4cce4a1
      Nikolay Shirokovskiy authored
      This will bring new ibuf_truncate method.
      
      Part of #7939
      
      NO_TEST=internal
      NO_CHANGELOG=internal
      NO_DOC=internal
      
      (cherry picked from commit 45c9a096)
      e4cce4a1
    • Vladimir Davydov's avatar
      Bump small submodule · 136a4a46
      Vladimir Davydov authored
      This commit pulls matras statistics.
      
      Needed for https://github.com/tarantool/tarantool-ee/issues/143
      
      NO_DOC=refactoring
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      
      (cherry picked from commit 1ea236e7)
      136a4a46
  2. May 24, 2023
    • Igor Munkin's avatar
      luajit: bump new version · c642959c
      Igor Munkin authored
      * LJ_GC64: Make ASMREF_L references 64 bit.
      * lldb: introduce luajit-lldb
      * x64/LJ_GC64: Fix emit_rma().
      * Limit path length passed to C library loader.
      
      Part of #4808
      Part of #8069
      Part of #8516
      
      NO_DOC=LuaJIT submodule bump
      NO_TEST=LuaJIT submodule bump
      c642959c
    • Ilya Verbin's avatar
      box: fix unique violation in functional index with nullable parts · 0ef3489a
      Ilya Verbin authored
      Currently is_nullable property of a functional index part disables the
      unique property of the index. The bug is in func_index_compare(), which
      compares functional keys first, and if they are equal it compares the
      primary keys. This behaviour is correct only when some part of the key
      is NULL (and for non-unique indexes), but for now the primary keys are
      compared unconditionally. Fix this by checking for NULL key parts.
      
      Closes #8587
      
      NO_DOC=bugfix
      
      (cherry picked from commit 6bcd51f9)
      0ef3489a
  3. May 23, 2023
    • Mergen Imeev's avatar
      sql: check printf() for failure · 89290d2b
      Mergen Imeev authored
      This patch adds a check that sqlXPrintf() does not fail in the built-in
      SQL function printf(). There are two possible problems: the result might
      get too large, or there might be an integer overflow because internally
      int values are converted to size_t.
      
      Closes #tarantool/security#122
      
      NO_DOC=bugfix
      
      (cherry picked from commit 13159230)
      Unverified
      89290d2b
    • Mergen Imeev's avatar
      sql: assert in xferOptimization() · ab61f770
      Mergen Imeev authored
      This patch fixes problems with INSERT INTO ... SELECT FROM optimization.
      These problems appeared after 6b8acd8f, where the check became redundant,
      but was not updated. Two problems arose:
      1) an assertion or segmentation fault when optimization was used and the
      source space does not have an index;
      2) optimization can be used even if the indexes are incompatible.
      
      The second problem does not result in changes that are user-visible, so
      there is no test.
      
      Closes #8661
      
      NO_DOC=bugfix
      
      (cherry picked from commit 039f714d)
      Unverified
      ab61f770
  4. May 16, 2023
    • Oleg Babin's avatar
      datetime: fix invalid representation of timestamps with fraction part · daad1e77
      Oleg Babin authored
      Sometimes we need negative timestamps to work with dates before
      1970. But seems such cases were even covered in tests. So there
      wasn't any handling of negative timestamps with fraction part.
      Such datetime objects had incorrect string representation (e.g.
      "1963-11-22T12:30:02.-999"). This patch fixes it.
      
      Closes #8570
      
      NO_DOC=bugfix
      
      (cherry picked from commit 8e7514b9)
      Unverified
      daad1e77
    • Oleg Babin's avatar
      datetime: fix negative nsec handling · 87af7a08
      Oleg Babin authored
      Seems that problem code part was ported from Lua as is. But there
      is some difference between modulo operator in C and in Lua. Lua
      always returns positive value but in C result could be negavive.
      This difference led to the case when after subtraction nsec part
      of datetime object become negative that yielded weird result on
      attempt to get string representation (e.g."2008-02-03T03:36:43.-100Z").
      This patch fixes it.
      
      Part of #8570
      
      NO_DOC=bugfix
      NO_CHANGELOG=see next commit
      
      (cherry picked from commit a9c7639a)
      Unverified
      87af7a08
  5. May 15, 2023
    • Andrey Saranchin's avatar
      iproto: export IPROTO constants to Lua automatically · cbcd5982
      Andrey Saranchin authored
      Currently, to export IPROTO constants to Lua, we define a translation
      table in C manually. As a result, some constants are forgotten and some
      are exported with mistakes.
      
      Fortunately, we have a mechanism to generate enums and its stringified
      names in compile-time. Let's rewrite iproto constants using such mechanism
      and generate translation table automatically.
      
      Closes #8443
      Closes #8574
      Closes #8577
      
      NO_DOC=bugfix
      
      (cherry picked from commit b3fb883b)
      cbcd5982
    • Andrey Saranchin's avatar
      iproto: rename IPROTO_KEY_MAX to iproto_key_MAX · 0f823554
      Andrey Saranchin authored
      We are going to generate iproto_key enum automatically to generate iproto
      constants for Lua as well. This mechanism generates *_MAX constant for enum
      using its name, which is in lower case. So let's convert IPROTO_KEY_MAX to
      form which is appropriate for enum generator.
      
      Part of #8443
      
      NO_TEST=rename constant
      NO_CHANGELOG=internal
      NO_DOC=internal
      
      (cherry picked from commit 82474b46)
      0f823554
    • Oleg Babin's avatar
      datetime: fix error when timestamp is set with nsec/usec/msec · 42101028
      Oleg Babin authored
      This patch fixes a case when timestamp is passed to datetime.set
      function at the same time with nsec, usec or msec.
      It works fine for datetime.new but some logic was missed for set
      function. Here we fix that and introduce a test.
      
      Closes #8583
      
      NO_DOC=bugfix
      
      (cherry picked from commit e0855097)
      Unverified
      42101028
    • Vladimir Davydov's avatar
      box: exclude uncommitted alter records from snapshot · e44ab84d
      Vladimir Davydov authored
      With MVCC off (box.cfg.memtx_use_mvcc_engine = false), a memtx space
      read view may include a dirty (not committed to WAL) record. To prevent
      such records from being written to a snapshot, we sync WAL after
      creating a read view for a snapshot. The problem is that it doesn't work
      for long (yielding) DDL operations, such as building a new index,
      because such operations yield before waiting on WAL. As a result,
      a dirty DDL record may make it to a snapshot even though it may fail
      eventually. To fix that, let's keep track of all yielding DDL statements
      and exclude them from a read view using the memtx snapshot cleaner.
      
      Closes #8530
      
      NO_DOC=bug fix
      
      (cherry picked from commit a532e375)
      e44ab84d
    • Vladimir Davydov's avatar
      iproto: send IPROTO_WATCH sync number in IPROTO_EVENT packet · e216fc2e
      Vladimir Davydov authored
      We don't use this functionality in net.box (sync number is always 0 for
      all watch/event packets), but other clients may actually use it.
      
      Closes #8393
      
      @TarantoolBot document
      Title: Document that `IPROTO_EVENT` has sync number
      
      Initially the sync number sent by a client in an `IPROTO_WATCH` request
      was ignored and `IPROTO_EVENT` packet didn't have a sync number. There
      were complaints about it from users so we consider this to be a bug.
      Now the server sends the same sync number in an `IPROTO_EVENT` packet
      as the one sent by the client in the last corresponding `IPROTO_WATCH`
      request.
      
      (cherry picked from commit 99389ac6)
      e216fc2e
  6. May 11, 2023
    • Sergey Ostanevich's avatar
      flaky: fix the qsync_advanced test · d891995d
      Sergey Ostanevich authored
      Add necessary wait for replication to appear on the replica, enforce
      correct txn isolation to avoid memtx/vinyl discrepancy.
      Remove the test from the fragile list.
      
      Closes tarantool/tarantool-qa#292
      
      NO_DOC=test fix
      NO_CHANGELOG=test fix
      
      (cherry picked from commit 3a220dad)
      d891995d
  7. May 05, 2023
  8. May 02, 2023
    • Gleb Kashkin's avatar
      box: allow to set box.cfg table value via env var · c508e520
      Gleb Kashkin authored
      All box.cfg options values used to be plain values or arrays. Now some
      options contain key-value or nested tables.
      
      This patch allows all such options to be set through environment
      variables too.
      
      Closes #8494
      Closes #8051
      
      @TarantoolBot document
      Title: Set box.cfg table value via env vars
      
      This patch implements a way to set tables as box.cfg options value in
      two different ways:
      * as plain key-value table:
      ```
      bash> export TT_LOG_MODULES=aaa=info,bbb=error && ./tarantool
      Tarantool 2.10.0-beta1-1977-g2970bd57a
      type 'help' for interactive help
      tarantool> box.cfg{}
      ...
      2023-04-11 07:22:10.951 [219020] main/103/interactive/box.load_cfg I> set \
      'log_modules' configuration option to {"aaa":"info","bbb":"error"}
      ---
      ...
      
      tarantool> box.cfg.log_modules.aaa
      ---
      - info
      ...
      
      tarantool> box.cfg.log_modules.bbb
      ---
      - error
      ...
      ```
      
      * as a table in json encoding (important: don't forget to put env var
        value into single quotes):
      NO_WRAP
      ```
      bash> export TT_METRICS='{"labels":{"alias":"mystorage"},"include":"all","exclude":["vinyl"]}' && ./tarantool
      Tarantool 2.10.0-beta1-1977-g2970bd57a
      type 'help' for interactive help
      tarantool> box.cfg{}
      ...
      2023-04-11 07:26:03.635 [219288] main/103/interactive/box.load_cfg I> set \
      'metrics' configuration option to {"exclude":["vinyl"],"include":"all",\
      "labels":{"alias":"mystorage"}}
      ---
      ...
      
      tarantool> box.cfg.metrics.include
      ---
      - all
      ...
      ```
      NO_WRAP
      
      (cherry picked from commit cd58c321)
      Unverified
      c508e520
  9. Apr 27, 2023
    • Vladimir Davydov's avatar
      static-build: enable compiler optimizations for dependencies · 817e4e13
      Vladimir Davydov authored
      An autoconf-generated configure script doesn't enable compiler
      optimization flags if CFLAGS / CXXFLAGS options are set explicitly.
      We started setting CFLAGS / CXXFLAGS in commit e6abe1c9
      ("cmake: add extra security compiler options"). As a result, users
      started experiencing performance degradation issues, like the one
      described in tarantool/tarantool-ee#440.
      
      Let's set -O2 in CFLAGS / CXXFLAGS explicitly to fix that.
      
      Closes #8606
      Needed for tarantool/tarantool-ee#440
      
      NO_DOC=build
      NO_TEST=build
      
      (cherry picked from commit 52f6ed4d)
      817e4e13
  10. Apr 26, 2023
    • Serge Petrenko's avatar
      test: re-enable linearizable test after fix · 38f83f40
      Serge Petrenko authored
      The test flaked a lot on FreeBSD and Mac OS due to some proxy problems
      which were fixed in scope of tarantool/luatest@5b704ac.
      
      Another possible failure looked like this:
      
      NO_WRAP
      [006] not ok 5  linearizable-read.test_leader_change
      [006] #   Can't modify data on a read-only instance - it is an orphan
      [006] #   stack traceback:
      [006] #         ...tarantool/test/replication-luatest/linearizable_test.lua:196: in function 'linearizable-read.test_leader_change'
      [006] #         ...
      [006] #         [C]: in function 'xpcall'
      NO_WRAP
      
      Fix it by waiting for the server to follow its upstreams.
      
      Closes tarantool/tarantool-qa#277
      
      NO_DOC=test fix
      NO_CHANGELOG=test fix
      
      (cherry picked from commit b71fa1a7)
      Unverified
      38f83f40
  11. Apr 25, 2023
    • Mergen Imeev's avatar
      core: fix possible integer overflow in net_box.c · 7f9f1c4b
      Mergen Imeev authored
      The netbox_transport_send_and_recv() function takes a part of the
      response size as a parameter, and it is possible that the resulting size
      could become larger than SIZE_MAX, resulting in an integer overflow and
      a segmentation fault.
      
      Closes #tarantool/security#121
      
      NO_DOC=bugfix
      
      (cherry picked from commit 5ce31144)
      7f9f1c4b
  12. Apr 24, 2023
    • Nikita Zheleztsov's avatar
      replication: fix updating is_candidate in raft · c6ec451e
      Nikita Zheleztsov authored
      Currently on applier death `is_candidate` is updated after trying
      to start election. So, raft assumes it has healthy quorum and
      bumps term even when there's not enough healthy nodes to do that.
      
      Trigger on updating above-mentioned flag is run in
      `replicaset_on_health_change`. So, let's move it before executing
      `raft_notify_is_leader_seen`, which tries to start election.
      
      Closes #8433
      
      NO_DOC=bugfix
      
      (cherry picked from commit f077ebf6)
      c6ec451e
  13. Apr 22, 2023
  14. Apr 21, 2023
    • Oleg Chaplashkin's avatar
      test: bump test-run to new version · 0835ad23
      Oleg Chaplashkin authored
      Bump test-run to new version with the following improvements:
      
      - Bump luatest to 0.5.7-38-ge6a2093 [1]
      
      [1] tarantool/test-run@affa13f
      
      NO_DOC=testing stuff
      NO_TEST=testing stuff
      NO_CHANGELOG=testing stuff
      
      (cherry picked from commit c5f5ee0d)
      Unverified
      0835ad23
  15. Apr 17, 2023
    • Ilya Verbin's avatar
      cmake: always define TARGET_OS_* to 0 or 1 · 3b167cf3
      Ilya Verbin authored
      There is a system include file TargetConditionals.h on macOS, which
      defines TARGET_OS_LINUX (and others) to 0 or 1. On the other side,
      TARGET_OS_LINUX is also defined by trivia/config.h.cmake, but there it
      has another possible values: undefined or 1. This inconsistency causes
      issues like #8445, when TARGET_OS_LINUX is defined (to 0) in one file
      and undefined in another. Let's always define it to 0 or 1.
      
      Closes #8445
      
      NO_DOC=bugfix
      
      (cherry picked from commit 19b53ac3)
      3b167cf3
    • Vladimir Davydov's avatar
      lua: add malloc info · d394b194
      Vladimir Davydov authored
      This commit adds two new Lua functions:
       - `box.malloc.info()` is a public function that returns the total
         memory usage of internal data structures allocated with `malloc()`.
         This information is extracted from the `malloc_info()` output.
         See the doc bot request for details.
       - `box.malloc.internal.info()` is an internal function that returns
         a parsed XML document returned by `malloc_info()` as is. It isn't
         documented. We may need it to get the detailed information about
         the system memory allocator.
      
      Both functions are useful only on Linux and only if ASAN is disabled
      because otherwise `malloc_info()` is unavailable. On other platforms
      `box.malloc.info()` reports zero memory usage while `internal.info()`
      returns an empty table.
      
      Closes #7311
      
      @TarantoolBot document
      Title: Document `box.malloc.info()`
      
      `box.malloc.info()` is a function that returns a table with two fields:
      
      ```
      tarantool> box.malloc.info()
      ---
      - size: 2498560
        used: 1835726
      ...
      ```
      
      The `used` value is the total amount of memory in bytes allocated by
      Tarantool for internal data structures with [`malloc()`][1].
      
      The `size` value is the total amount of memory in bytes allocated from
      the system by the `malloc()` allocator. It may not be less than `used`.
      
      The function may be used before `box.cfg()` is called.
      
      Currently, the function is available only on Linux. On other systems it
      reports zero memory usage (`{size = 0, used = 0}`).
      
      [1]: https://man7.org/linux/man-pages/man3/malloc.3.html
      
      (cherry picked from commit d34a0cbc)
      d394b194
    • Vladimir Davydov's avatar
      lua: add internal xml parser · 24521304
      Vladimir Davydov authored
      We need an XML parser to parse the string returned by malloc_info.
      This commit implements a simple parser in Lua C that transforms
      an XML string into a Lua table. The parser is available both from
      C (luaT_xml_decode) and Lua (internal.xml.decode).
      
      Needed for #7311
      
      NO_DOC=internal
      NO_CHANGELOG=internal
      
      (cherry picked from commit 5f596b25)
      24521304
    • Mergen Imeev's avatar
      sql: limit memory allocation in REPLACE() · 29bdcedb
      Mergen Imeev authored
      This patch limits the amount of allocated memory in the built-in
      REPLACE() function.
      
      Follow-up tarantool/security#119
      
      NO_DOC=bugfix
      NO_CHANGELOG=already exists
      
      (cherry picked from commit be3034ab)
      29bdcedb
  16. Apr 13, 2023
  17. Apr 12, 2023
  18. Apr 10, 2023
    • Georgy Moiseev's avatar
      test: disable override checks · 31b678b4
      Georgy Moiseev authored
      NO_DOC=Test update
      NO_CHANGELOG=Test update
      
      (cherry picked from commit 22d7636b)
      31b678b4
    • Georgy Moiseev's avatar
      lua: bump checks module · cb1da0f0
      Georgy Moiseev authored
      Rework "running tests with built-in package" assert since now checks is
      a callable table package with subpackages instead of a single function.
      
      NO_DOC=No tagged version since checks initial embedding
      NO_CHANGELOG=No tagged version since checks initial embedding
      
      (cherry picked from commit a8bc6312)
      cb1da0f0
    • Mergen Imeev's avatar
      sql: fix integer overflow in built-in functions · ed39f7df
      Mergen Imeev authored
      This patch replaces the type for some int and uint32_t values with
      size_t to avoid problems with integer overflow.
      
      Closes tarantool/security#119
      
      NO_DOC=bugfix
      
      (cherry picked from commit 60a187d7)
      ed39f7df
Loading