Skip to content
Snippets Groups Projects
  1. Jan 10, 2023
  2. Dec 29, 2022
    • Yaroslav Lobankov's avatar
      ci: fix pull_request trigger for coverage workflow · 630c79a0
      Yaroslav Lobankov authored
      The coverage workflow is a part of the default testing, so there is no
      sense to run this workflow when the 'full-ci' label is set. Moreover, it
      cancelled the run of the default testing and started the run of the full
      testing due to workflow `concurrency`.
      
      By default, a workflow only runs when a `pull_request` event's activity
      type is `opened`, `synchronize`, or `reopened`. That's why there is no
      sense in the following construction:
      
        pull_request:
          types: [ opened, reopened, synchronize ]
      
      So just removed the line related to event's activity type.
      
      NO_DOC=ci
      NO_TEST=ci
      NO_CHANGELOG=ci
      
      (cherry picked from commit 182034dc)
      Unverified
      630c79a0
    • viacheslav.kirichenko's avatar
      ci: add integration testing for ddl and crud · da461cd3
      viacheslav.kirichenko authored
      Add workflow for integration testing of ddl
      and crud modules.
      
      Resolves tarantool/tarantool#6619
      Resolves tarantool/tarantool#6620
      
      NO_DOC=ci
      NO_TEST=ci
      NO_CHANGELOG=ci
      
      (cherry picked from commit 53f41130)
      da461cd3
  3. Dec 25, 2022
    • Alexander Turenko's avatar
      test: stabilize jit.dump() smoke test · d4f6e796
      Alexander Turenko authored
      
      A jiggle in tarantool's initialization code can lead to trace numbers
      above 9. We can either:
      
      * accept trace numbers above 9 in the test
      * or drop traces from the initialization code in the test and assume
        that the new trace will have number 1.
      
      Igor Munkin suggested to stick with the second approach to avoid
      dependency on the initialization code.
      
      NO_DOC=test fixup, no user visible changes
      NO_CHANGELOG=see NO_DOC
      
      Co-authored-by: default avatarIgor Munkin <imun@tarantool.org>
      (cherry picked from commit 92794ddc)
      Unverified
      d4f6e796
  4. Dec 23, 2022
    • Ilya Verbin's avatar
      core: unblock fatal (crashing) signals in all threads · 1c176245
      Ilya Verbin authored
      Currently all non-main threads have all the signals blocked, however
      according to `man pthread_sigmask':
      
      > If SIGBUS, SIGFPE, SIGILL, or SIGSEGV are generated while they
      > are blocked, the result is undefined, unless the signal was
      > generated by kill(2), sigqueue(3), or raise(3).
      
      On macOS they are actually blocked, causing the faulting instruction
      to loop indefinitely. While on Linux they are not blocked, however the
      signal handler registered by sigaction is not executed. Don't block them.
      
      Closes #8023
      Closes #8083
      
      NO_DOC=bugfix
      
      (cherry picked from commit 706bfea4)
      1c176245
    • Ilya Verbin's avatar
      crash: handle all unblockable signals · 6290b041
      Ilya Verbin authored
      There are 4 fatal signals that cannot be blocked by sigmask if they
      are caused by the CPU exception (rather than kill, sigqueue or raise):
      SIGILL, SIGBUS, SIGFPE, SIGSEGV. Currently the crash module handles
      only SIGSEGV and SIGFPE. This patch adds handlers for SIGBUS and SIGILL.
      SIGBUS is usually raised by macOS on access to the unmapped memory, and
      SIGILL is possible, for example, while running AVX version of memcpy on
      a CPU without AVX support.
      
      Faulting address siginfo->si_addr is valid for all these signals, so
      print it unconditionally.
      
      Part of #8023
      Part of #8083
      
      NO_DOC=See next commit
      NO_CHANGELOG=See next commit
      
      (cherry picked from commit 6c3ce7a6)
      6290b041
    • Andrey Saranchin's avatar
      core: drop constraints in two phases · 535decdf
      Andrey Saranchin authored
      Currently, core constraints are dropped on commit. That is why
      it is impossible to drop constraint and drop objects it references to
      at the same transaction. Let's drop constraints in two steps - detach
      them when DDL occurs, then reattach on rollback or delete on commit.
      
      Closes #7339
      
      NO_DOC=bugfix
      
      (cherry picked from commit f72efbc2)
      535decdf
  5. Dec 21, 2022
    • Ilya Verbin's avatar
      box: do not close xlog file descriptors in the atfork handler · ea4c2567
      Ilya Verbin authored
      Use O_CLOEXEC flag instead.
      
      If Tarantool is forked before executing box.cfg{}, e.g. using io.popen(),
      the child process could start with stdin linked to /dev/urandom.
      This happens because wal_writer_singleton and vy_log_writer are not yet
      initialized, i.e. `fd' fields are 0, then atfork child handler wal_atfork()
      is called. It checks that xlog is opened (the check succeeded as 0 != -1)
      and closes its fd 0, in fact closing stdin (twice). Next, Tarantool opens
      the file /dev/urandom during initialization, and it receives the lowest
      unused file descriptor, which is 0. Then luaL_loadfile() loads stdin as a
      Lua chunk, in effect reading random numbers.
      
      This happens on glibc 2.28 and older, as newer versions do not invoke
      atfork handlers during io.popen():
      https://sourceware.org/bugzilla/show_bug.cgi?id=17490
      
      Closes #7886
      
      NO_DOC=bugfix
      NO_TEST=Tested by test/app-luatest/gh_5747_crash_multiple_args_test.lua
      
      (cherry picked from commit ec1af129)
      ea4c2567
    • Mergen Imeev's avatar
      sql: correctly calculate argument types · 3f229cff
      Mergen Imeev authored
      This patch fixes an issue where collation could change the computed
      type of a built-in function argument when choosing a function
      implementation.
      
      Closes #7992
      
      NO_DOC=bugfix
      
      (cherry picked from commit 1c80ce2d)
      3f229cff
    • Nick Volynkin's avatar
      ci: test stable branches with SDK · d714033a
      Nick Volynkin authored
      Workflow submodule_update now brings latest commits in stable branches
      further to tarantool/sdk, where integration tests can run with other
      enterprise products and modules.
      
      In tarantool/tarantool-ee a pull request is still opened, so the
      maintainers can merge it at any time.
      
      In tarantool/sdk the test branches are named in the following pattern:
      `TarantoolBot/test-ce-master`
      `TarantoolBot/test-ce-2.10`
      and so on. This pattern can be easily distinguished by workflows,
      which run integration tests and alert developers on failures.
      It is also consistent with branches with the same purpose of integration
      testing, that are created by the sdk_test workflow:
      `TarantoolBot/test-ce-{feature_branch_name}`
      
      NO_DOC=CI
      NO_TEST=CI
      NO_CHANGELOG=CI
      
      Resolves tarantool/sdk#355
      
      (cherry picked from commit 60a2ee11)
      d714033a
  6. Dec 20, 2022
    • Ilya Verbin's avatar
      test: do jit.flush() after jit.off() on arm64 · 9a97707b
      Ilya Verbin authored
      JIT has been disabled for these 3 tests on arm64 to avoid weird fails, but
      they are still flaky in CI. Perhaps the JIT traces from other tests affect
      them. Let's try to do jit.flush() together with jit.off().
      
      Also disable JIT for pagination_netbox_test.lua, which suffers from the
      same problem as pagination_test.lua.
      
      Part of #6599
      Part of #7739
      Part of #8011
      
      NO_DOC=testing stuff
      NO_CHANGELOG=testing stuff
      
      (cherry picked from commit 2695f66a)
      9a97707b
  7. Dec 16, 2022
    • Yaroslav Lobankov's avatar
      test: use luatest modules instead of internal ones · 926acb84
      Yaroslav Lobankov authored
      Some internal modules have been recently copied to luatest repo [1] and
      now they can be safely removed, and the corresponding functionality from
      luatest can be used instead.
      
      Affected modules:
      
      - test/luatest_helpers/cluster.lua
      
      [1] tarantool/luatest#271
      
      Closes tarantool/luatest#237
      Closes tarantool/luatest#269
      
      NO_DOC=testing stuff
      NO_TEST=testing stuff
      NO_CHANGELOG=testing stuff
      
      (cherry picked from commit 62ffc72c)
      926acb84
    • Yaroslav Lobankov's avatar
      test: bump test-run to version w/ updated luatest · b4cda6bd
      Yaroslav Lobankov authored
      Bump test-run to new version with the following improvements:
      
      - Bump luatest to 0.5.7-20-g48c406a [1]
      
      [1] tarantool/test-run#366
      
      Part of tarantool/luatest#237
      
      NO_DOC=testing stuff
      NO_TEST=testing stuff
      NO_CHANGELOG=testing stuff
      
      (cherry picked from commit 903211df)
      b4cda6bd
    • Maxim Kokryashkin's avatar
      lua: use cur_L in cord_on_yield · 9f4d315c
      Maxim Kokryashkin authored
      Before the patch, fiber->storage.lua.stack is used for
      `panic` calls. However, some fibers don't have any Lua
      state saved in their storage (for example, space
      triggers).
      
      After the patch, the Lua state pointed by `cur_L` is
      used to make those calls, as it is always present.
      
      Closes #6647
      NO_DOC=bugfix
      
      (cherry picked from commit dfe79b9a)
      Unverified
      9f4d315c
  8. Dec 14, 2022
    • Vladimir Davydov's avatar
      vinyl: fix potential null-ptr dereference in vy_read_view_merge · 2a4f3e80
      Vladimir Davydov authored
      The 'copy' ptr is checked for NULL after dereferencing. Found by PVS.
      
      https://jira.vk.team/browse/TNT-698
      
      It can hardly result in a null-ptr dereference, because vy_stmt_dup()
      uses malloc(), which doesn't normally fail (instead, the OOM killer just
      kills the process if there's a severe shortage of memory, see #3534).
      Still, PVS rightfully complains about it so let's fix it.
      
      Fixes commit 902d212b ("vinyl: zap vy_write_iterator->format")
      
      NO_DOC=bug fix
      NO_TEST=unreproducible
      NO_CHANGELOG=unreproducible
      
      (cherry picked from commit de175b97)
      2a4f3e80
  9. Dec 13, 2022
    • Nick Volynkin's avatar
      ci: use actions/checkout@v3.1.0 with FreeBSD · 2631be0e
      Nick Volynkin authored
      ChristopherHX/github-act-runner@0.4.1, which we use on FreeBSD,
      is incompatible with newest actions/checkout@v3.2.0, aliased to @v3.
      Until this is resolved, FreeBSD workflows will use fixed version
      actions/checkout@v3.1.0.
      
      actions/checkout@v3.2.0 fails with an unclear error:
      
      > :star:  Run actions/checkout@v3
      >   :cloud:  git clone 'https://github.com/actions/checkout' # ref=v3
      > Error: Unable to resolve v3: unsupported object type
      > Error: Unable to resolve v3: unsupported object type
      > Error:   :x:  Failure - actions/checkout@v3
      > Error: unsupported object type
      
      NO_DOC=CI
      NO_TEST=CI
      NO_CHANGELOG=CI
      
      (cherry picked from commit a79d32b1)
      2631be0e
  10. Dec 12, 2022
  11. Dec 08, 2022
  12. Dec 07, 2022
    • Vladimir Davydov's avatar
      box: don't stop parsing authentication request if user doesn't exist · 995d2a00
      Vladimir Davydov authored
      Currently, we stop without checking the authentication request body if
      the specified user doesn't exist. As a result, one can check if a user
      exists by sending a malformed authentication request: for an existing
      user, the server will reply with ER_INVALID_MSGPACK error while if the
      user doesn't exist, the error will be set to ER_CREDS_MISMATCH. To fix
      this, let's parse the authentication request body even if the user
      doesn't exist.
      
      Closes https://github.com/tarantool/security/issues/21
      
      NO_DOC=bug fix
      
      (cherry picked from commit 42badb87)
      995d2a00
    • Vladimir Davydov's avatar
      box: run box.session.on_auth triggers if the user doesn't exist · e1a79d79
      Vladimir Davydov authored
      The triggers are supposed to run on any authentication attempt,
      successful or not. Without it, the admin may not notice a malefactor
      enumerating user names.
      
      Closes #8017
      
      NO_DOC=bug fix
      
      (cherry picked from commit 8a2f1653)
      e1a79d79
    • Vladimir Davydov's avatar
      box: drop redundant guest password checks from authenticate · 586b1ffb
      Vladimir Davydov authored
      The guest can't have a non-empty password - it's explicitly prevented by
      the _user trigger callback:
      
      https://github.com/tarantool/tarantool/blob/2ed06651c317f2d46631b0d55e4b88f2c8a6c0a0/src/box/alter.cc#L2930-L2936
      
      So there's no need to check the guest user password in authenticate.
      
      NO_DOC=code cleanup
      NO_TEST=code cleanup
      NO_CHANGELOG=code cleanup
      
      (cherry picked from commit 26f69561)
      586b1ffb
    • Ilya Verbin's avatar
      log: improve logging of tables · 9e986ee9
      Ilya Verbin authored
      1. Fixed modification of a variable passed to the logging function
         (both log formats)
      
         tarantool> a = {foo = 'bar', file = 'c://autorun.bat'}
         tarantool> log.info(a)
         [...]
         tarantool> a
         (before) - foo: bar
          (after) - foo: bar
                    file: c://autorun.bat
      
      2. Fixed the drop of fields with reserved internal names (plain log format)
      
         tarantool> log.info({foo = 'bar', pid = 666})
         (before) {"foo":"bar"}
          (after) {"foo":"bar","pid":666}
      
      3. Now if 'message' field is absent, it is set to the first field of the
         table (JSON log format)
      
         tarantool> log.info({'Hello, world', key = 'value'})
         (before) {[...], "1":"Hello, world", "key":"value", [...]}
          (after) {[...], "message":"Hello, world", "key":"value", [...]}
      
      4. Fixed assertion on a table without string keys (JSON log format)
      
         If a Lua table, passed to say(), contains only integer indexes,
         json.encode() will encode it as an array rather than a map, thereafter
         say_format_json() will produce improperly formatted JSON string, or get
         assertion failure. Fix it by encoding all kinds of tables as maps.
      
      Closes #3853
      Closes #7955
      
      NO_DOC=Mostly bug fixes, the format of the JSON log is not documented.
      
      (cherry picked from commit 85ef1118)
      9e986ee9
    • Ilya Verbin's avatar
      test: fix flaky gh_6539_log_user_space_empty_or_nil_select_test · 81c021c3
      Ilya Verbin authored
      Turn LuaJIT off for this test on AArch64 in the scope of the issue [1].
      
      Also increase grep_log_bytes. Currently the message is 235 byte long,
      which is pretty close to 256. If one more item is added to the traceback,
      the test will fail.
      
      ```
      C> Potentially long select from space 'test_memtx' (512)
       stack traceback:
              builtin/box/schema.lua:2528: in function 'check_select_safety'
              builtin/box/schema.lua:2545: in function 'select'
              eval:1: in main chunk
              [C]: at 0x556e8ffd5c
      ```
      
      [1] Related to #8011
      Closes tarantool/tarantool-qa#264
      
      NO_DOC=test fix
      NO_CHANGELOG=test fix
      
      (cherry picked from commit 84306671)
      81c021c3
    • Igor Munkin's avatar
      luajit: bump new version · 38717877
      Igor Munkin authored
      * Fix narrowing of unary minus.
      * Don't compile math.modf() anymore.
      * OSX/ARM64: Fix external unwinding.
      * Fix build with busybox grep.
      * BSD: Fix build with BSD grep.
      * OSX/ARM64: Disable unwind info.
      * ARM64: Reorder interpreter stack frame and fix unwinding.
      * OSX/ARM64: Disable external unwinding for now.
      * OSX: Fix build by hardcoding external frame unwinding.
      * Cleanup and enable external unwinding for more platforms.
      * test: remove TAP side effects in getmetrics tests
      * test: relax JIT setup in misc.getmetrics test
      * test: relax JIT setup in lj-430-maxirconst test
      * GC64: enable sysprof support
      
      Closes #6096
      Closes #6976
      Closes #7919
      Relates to #781
      Relates to #7762
      Part of #7230
      
      NO_DOC=LuaJIT submodule bump
      NO_TEST=LuaJIT submodule bump
      38717877
  13. Dec 06, 2022
  14. Dec 05, 2022
    • Yaroslav Lobankov's avatar
      test: use luatest modules instead of internal ones · c7b4118f
      Yaroslav Lobankov authored
      Some internal modules have been recently copied to luatest repo [1,2]
      and now they can be safely removed, and the corresponding functionality
      from luatest can be used instead.
      
      Affected modules:
      
      - test/luatest_helpers/server.lua
      
      [1] tarantool/luatest#258
      [2] tarantool/luatest#266
      
      Closes tarantool/luatest#239
      
      NO_DOC=testing stuff
      NO_TEST=testing stuff
      NO_CHANGELOG=testing stuff
      
      (cherry picked from commit 21fc0770)
      c7b4118f
    • Yaroslav Lobankov's avatar
      test: bump test-run to version w/ updated luatest · 52b8e01a
      Yaroslav Lobankov authored
      Bump test-run to new version with the following improvements:
      
      - Bump luatest to 0.5.7-17-g1387aa8 [1]
      
      [1] tarantool/test-run#360
      
      Part of tarantool/luatest#239
      
      NO_DOC=testing stuff
      NO_TEST=testing stuff
      NO_CHANGELOG=testing stuff
      
      (cherry picked from commit 9687656f)
      52b8e01a
    • Vladislav Shpilevoy's avatar
      test: factor wal play until "synchro busy" out · eb672b4a
      Vladislav Shpilevoy authored
      The function play_wal_until_synchro_queue_is_busy() was used in a
      few tests copy-pasted since it was considered to be too specific
      for a few rare tests. But apparently it is going to be used again
      in a new test in a future commit.
      
      The patch makes this function a method of server object to reuse
      it properly.
      
      Needed for #7253
      
      NO_DOC=refactoring
      NO_CHANGELOG=refactoring
      
      (cherry picked from commit 135fd0ff)
      eb672b4a
    • Ilya Verbin's avatar
      cmake: fix wrong CPU architecture reported on M1/M2 Macs · 106b856a
      Ilya Verbin authored
      This patch removes an old CMake kludge, which sets CMAKE_SYSTEM_PROCESSOR
      to "x86_64" on all 64-bit architectures, even on ARM (on Darwin).
      
      Closes #7495
      
      NO_DOC=bugfix
      
      (cherry picked from commit d76be7ef)
      106b856a
  15. Dec 02, 2022
    • Ilya Verbin's avatar
      backtrace: update sp before saving registers to a stack frame · ee1a94e3
      Ilya Verbin authored
      backtrace_collect() is suffering from the same issue as coro_transfer(),
      see commit 215630e6 ("coro: update sp before saving registers to a
      stack frame").
      
      It 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 backtrace_collect, 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
      backtrace_collect. The constraint of the input operand `bt` is changed
      from "m" to "r" to force `bt` always be passed to the inline assembly
      via the register. Passing on stack will not work after this fix.
      
      Closes #7985
      
      NO_DOC=bugfix
      NO_TEST=Hard to create a stable reproducer
      
      (cherry picked from commit 9adc4aa7)
      ee1a94e3
  16. Nov 30, 2022
    • Georgiy Lebedev's avatar
      memtx: fix logic of read tracker rebinding during rollback · 8eaf7436
      Georgiy Lebedev authored
      During rollback read trackers are rebound to newer or older story, if
      present. The problem with the current logic is that read trackers are
      basically rebound in the first available index: all information about key
      parts read from other indexes gets lost — rebind read trackers in all
      indexes.
      
      Closes #7828
      
      NO_DOC=bugfix
      
      (cherry picked from commit 559b27db)
      8eaf7436
    • Georgiy Lebedev's avatar
      memtx: fix use-after-free of successor in `tree_iterator_start` · fb2da349
      Georgiy Lebedev authored
      We assumed that the successor tuple's story could not get garbage collected
      on clarify of result tuple in `tree_iterator_start`, since they coincide in
      case of regular iterators. But this is not the case for reverse iterators:
      the result tuple is of-by-one from the successor, which means the
      successor's story can get garbage collected along with the tuple itself
      getting deleted, leading to use-after-free of successor: remove garbage
      collection from `memtx_tx_tuple_clarify` and call it manually.
      
      The crash in #7756 revealed that the `put` in transaction manager's story
      hash table was performed incorrectly: fix it and add an assertion that
      nothing was replaced.
      
      Closes #7755
      Closes #7756
      
      NO_DOC=bugfix
      
      (cherry picked from commit 651535bc)
      fb2da349
  17. Nov 29, 2022
    • Andrey Saranchin's avatar
      replication: make before_replace work better with space _cluster · c05023cc
      Andrey Saranchin authored
      Firstly, there is an assertion that checks if replica_id haven't been
      changed after it's registration. Let's replace this assertion with warning
      message about id being altered - new id will be used for affected replica.
      
      Secondly, if before_replace trigger, set on space _cluster, returns nil,
      tarantool will crash with segmentation fault. This patch handles the case.
      
      Closes #7846
      
      NO_DOC=bugfix
      
      (cherry picked from commit a470bb63)
      c05023cc
  18. Nov 25, 2022
    • Ilya Verbin's avatar
      test: fix flaky gh_6539_log_user_space_empty_or_nil_select_test · d60ab9dd
      Ilya Verbin authored
      The test fails with:
      
        not ok 2 ...ty_or_nil_select.test_log_entry_presence_for_memtx_user_space
        gh_6539_log_user_space_empty_or_nil_select_test.lua:122: log must contain
        a critical entry about `box.space.test_memtx:select({0}, {limit = 1001,
        iterator = "ALL"})` call on a memtx user space
        expected: a value evaluating to true, actual: nil
      
      Looks like it happens, because g.server:grep_log() is executed before
      g.server:eval(call) completes writing to the log.
      In other tests grep_log() is wrapped into t.helpers.retrying() in order
      to avoid such issues, so do the same here.
      
      May close tarantool/tarantool-qa#264
      
      NO_DOC=test fix
      NO_CHANGELOG=test fix
      
      (cherry picked from commit e4f1c891)
      d60ab9dd
  19. Nov 23, 2022
    • Vladimir Davydov's avatar
      vinyl: fix tuple missing in cache after reading rolled backed DELETE · 9e9c06da
      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
      
      (cherry picked from commit e00f16e4)
      9e9c06da
Loading