Skip to content
Snippets Groups Projects
  1. Dec 05, 2024
    • Dmitry Rodionov's avatar
      test: increase errinj_wait timeout · 43546f6b
      Dmitry Rodionov authored
      NO_DOC=internal
      NO_TEST=internal
      NO_CHANGELOG=internal
      43546f6b
    • Dmitry Rodionov's avatar
      test: quorum promote, dump whole upstream object for future debugging · a2066701
      Dmitry Rodionov authored
      Check sometimes fails, and it is uncelar exactly why, dump more info
      
      NO_DOC=internal
      NO_TEST=internal
      NO_CHANGELOG=internal
      a2066701
    • Dmitry Rodionov's avatar
      test: make test_two_stuch_outstanding_promotes less flaky · 69c025f3
      Dmitry Rodionov authored
      By retrying some safety checks a couple of times before giving up
      
      NO_DOC=internal
      NO_TEST=internal
      NO_CHANGELOG=internal
      69c025f3
    • Dmitry Ivanov's avatar
      fix: don't cpipe_push into a closed pipe in tx_status_update · 834e7141
      Dmitry Ivanov authored
      The bug was discovered during the development of the quorum promote feature
      -- basically, it causes qpromote_several_outstanding_promotes_test.lua
      to fail spontaneously. Furthermore, we suspect that this is the underlying
      cause of lost heartbeats and subsequent severe replication lags.
      
      Long story short, whenever we want to send a message from the TX thread
      back to a relay thread, we should first check if they are still
      connected. Otherwise, we'll see
        * An assertion failure in debug, or
        * (Presumably) a relay hangup in release due to
          `if (status_msg->msg.route != NULL) return;`
          in relay_status_update() -> relay_check_status_needs_update().
      
      The upstream is aware of this issue:
      https://github.com/tarantool/tarantool/issues/9920
      
      Backtrace:
      
      ```
      __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
      0x00007f891f6a5463 in __pthread_kill_internal (threadid=<optimized out>, signo=6) at pthread_kill.c:78
      0x00007f891f64c120 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
      0x00007f891f6334c3 in __GI_abort () at abort.c:79
      0x00007f891f6333df in __assert_fail_base (fmt=0x7f891f7c3c20 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n",
          assertion=assertion@entry=0x58560077b94b "loop() == pipe->producer", file=file@entry=0x58560077b935 "./src/lib/core/cbus.h", line=line@entry=224,
          function=function@entry=0x58560077b910 "void cpipe_push_input(cpipe*, cmsg*)") at assert.c:94
      0x00007f891f644177 in __assert_fail (assertion=0x58560077b94b "loop() == pipe->producer", file=0x58560077b935 "./src/lib/core/cbus.h", line=224,
          function=0x58560077b910 "void cpipe_push_input(cpipe*, cmsg*)") at assert.c:103
      0x0000585600328782 in cpipe_push_input (pipe=0x58563115dfc8, msg=0x58563115e028) at tarantool/src/lib/core/cbus.h:224
      0x0000585600328802 in cpipe_push (pipe=0x58563115dfc8, msg=0x58563115e028) at tarantool/src/lib/core/cbus.h:241
      0x000058560032a157 in tx_status_update (msg=0x58563115e028) at tarantool/src/box/relay.cc:629
      0x0000585600468d4b in cmsg_deliver (msg=0x58563115e028) at tarantool/src/lib/core/cbus.c:553
      0x0000585600469e50 in fiber_pool_f (ap=0x7f891e8129a8) at tarantool/src/lib/core/fiber_pool.c:64
      0x00005856001be16a in fiber_cxx_invoke(fiber_func, typedef __va_list_tag __va_list_tag *) (f=0x585600469b82 <fiber_pool_f>, ap=0x7f891e8129a8)
          at tarantool/src/lib/core/fiber.h:1283
      0x000058560045f495 in fiber_loop (data=0x0) at tarantool/src/lib/core/fiber.c:1085
      0x0000585600745b8f in coro_init () at tarantool/third_party/coro/coro.c:108
      ```
      
      Relevant frames:
      
      ```
      0x0000585600328782 in cpipe_push_input (pipe=0x58563115dfc8, msg=0x58563115e028) at tarantool/src/lib/core/cbus.h:224
      224             assert(loop() == pipe->producer);
      (gdb)
      0x0000585600328802 in cpipe_push (pipe=0x58563115dfc8, msg=0x58563115e028) at tarantool/src/lib/core/cbus.h:241
      241             cpipe_push_input(pipe, msg);
      (gdb)
      0x000058560032a157 in tx_status_update (msg=0x58563115e028) at tarantool/src/box/relay.cc:629
      629             cpipe_push(&status->relay->relay_pipe, msg);
      (gdb)
      0x0000585600468d4b in cmsg_deliver (msg=0x58563115e028) at tarantool/src/lib/core/cbus.c:553
      553             msg->hop->f(msg);
      (gdb)
      0x0000585600469e50 in fiber_pool_f (ap=0x7f891e8129a8) at tarantool/src/lib/core/fiber_pool.c:64
      64              cmsg_deliver(msg);
      (gdb)
      ```
      
      NO_DOC=internal
      NO_TEST=internal
      NO_CHANGELOG=internal
      834e7141
  2. Dec 04, 2024
  3. Nov 19, 2024
  4. Nov 16, 2024
    • Dmitry Ivanov's avatar
      fix(picodata): don't close stderr & stdout in log_destroy · 28cb2cfa
      Dmitry Ivanov authored
      Previously, log_destroy would close log->fd even if it's one of the
      standard streams. This behavior almost never makes sense, unless
      one's trying to write a unix daemon which is obviously not the case.
      
      Closing stderr has the following side effects:
      - it breaks a reinit of the default logger;
      - it inhibits ASan's final leak report;
      - it causes a EPOLLHUP during a restart via `--entrypoint-fd` (Picodata).
      
      NO_DOC=internal
      NO_TEST=internal
      NO_CHANGELOG=internal
      28cb2cfa
  5. Oct 11, 2024
    • Dmitry Ivanov's avatar
      feat(build): dump all include directories for box · 4396ba81
      Dmitry Ivanov authored
      This stores all of the include directories of box into a file
      called box-include-args. We use this to generate certain FFI
      bindings using rust-bindgen.
      
      NO_DOC=internal
      NO_TEST=internal
      NO_CHANGELOG=internal
      4396ba81
  6. Oct 10, 2024
  7. Oct 07, 2024
  8. Sep 27, 2024
    • Vladimir Davydov's avatar
      sptree: don't use variable length arrays · 6281e617
      Vladimir Davydov authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      This causes warnings if compiled with clang-18. Let's define a sane
      upper limit for the max tree depth and use it for allocating arrays
      on stack. Note that we don't really care about performance because
      sptree is used only in unit tests.
      
      Closes #10354
      
      NO_DOC=internal
      NO_TEST=internal
      NO_CHANGELOG=internal
      6281e617
    • Dmitry Ivanov's avatar
      misc: fix clang-specific warnings in luajit's asserts · ff87c937
      Dmitry Ivanov authored
      Apparently, clang 18 is not particularly happy about luajit's static
      assert implementation:
      
      ```
      In file included from tarantool/src/box/box.cc:38:
      In file included from tarantool/src/lua/utils.h:47:
      In file included from tarantool/third_party/luajit/src/lj_state.h:9:
      tarantool/third_party/luajit/src/lj_obj.h:488:1: error: variable length arrays in C++ are a Clang extension; did you mean to use 'static_assert'? [-Werror,-Wvla-extension-static-assert]
        488 | LJ_STATIC_ASSERT(offsetof(Node, val) == 0);
            | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      tarantool/third_party/luajit/src/lj_def.h:370:71: note: expanded from macro 'LJ_STATIC_ASSERT'
        370 |   extern void LJ_ASSERT_NAME(__COUNTER__)(int STATIC_ASSERTION_FAILED[(cond)?1:-1])
            |                                                                       ^~~~~~~~~~~
      tarantool/third_party/luajit/src/lj_obj.h:488:18: note: cast that performs the conversions of a reinterpret_cast is not allowed in a constant expression
        488 | LJ_STATIC_ASSERT(offsetof(Node, val) == 0);
            | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
      tarantool/src/trivia/util.h:273:33: note: expanded from macro 'offsetof'
        273 | #define offsetof(type, member) ((size_t) &((type *)0)->member)
            |                                 ^
      tarantool/third_party/luajit/src/lj_def.h:370:72: note: expanded from macro 'LJ_STATIC_ASSERT'
        370 |   extern void LJ_ASSERT_NAME(__COUNTER__)(int STATIC_ASSERTION_FAILED[(cond)?1:-1])
            |
      ```
      
      Luckily, we can just mute this.
      
      NO_DOC=<nothing interesting here>
      NO_TEST=<tested during build time>
      NO_CHANGELOG=<nothing interesting here>
      ff87c937
    • Dmitry Ivanov's avatar
      small: bump version · e2a4deb5
      Dmitry Ivanov authored
      New commits:
      * slab cache: fix slab alignment to 16 bytes
      
      This helps fix crashes in the ASan build.
      
      NO_DOC=internal
      NO_TEST=internal
      NO_CHANGELOG=internal
      e2a4deb5
  9. Sep 05, 2024
  10. Aug 30, 2024
    • Denis Smirnov's avatar
      feat: unprepare statement references after sql execution · 192bfc43
      Denis Smirnov authored
      Picodata SQL now manages the Tarantool statement cache using a
      dedicated SQL fiber that handles preparation and unpreparation of
      statements based on an LRU eviction policy. Prepared statements
      can be executed across different sessions by SQL clients.
      
      Previously, when a client executed a prepared statement, it
      increased the reference count in the statement cache and linked
      the statement to the client's session. While this approach seemed
      fine, it caused issues during eviction, as references to these
      statements remained in client sessions, preventing proper eviction.
      
      This commit addresses the issue by ensuring that if a statement is
      added to the current session during execution, it is removed and
      the session state is restored once execution is complete.
      
      NO_DOC=internal
      NO_CHANGELOG=internal
      192bfc43
  11. Aug 29, 2024
    • Denis Smirnov's avatar
      feat: avoid schema version bump for temporary spaces · 9a8559d8
      Denis Smirnov authored
      Temporary spaces, used for cluster-wide SQL data materialization,
      were causing unnecessary netbox schema version bumps, leading to
      schema downloading via netbox, excessive Lua garbage and GC blocks.
      Since these tables are for internal SQL use, we don't need to inform
      netbox clients about schema changes. We now maintain separate schema
      versions: one for netbox clients and one for the internal prepared
      statement cache.
      
      NO_DOC=picodata internal patch
      NO_CHANGELOG=picodata internal patch
      9a8559d8
  12. Aug 16, 2024
  13. Aug 08, 2024
  14. Aug 02, 2024
  15. Jul 30, 2024
  16. Jul 29, 2024
  17. Jul 26, 2024
  18. Jul 25, 2024
  19. Jul 24, 2024
  20. Jul 23, 2024
  21. Jul 19, 2024
    • Nikolay Shirokovskiy's avatar
      core: build fix for recent gcc · 6da92ae2
      Nikolay Shirokovskiy authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
      ```
      /home/shiny/dev/tarantool/src/lib/core/coio_task.c:114:58:
      	error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument
      	and not in the later argument [-Werror=calloc-transposed-args]
        114 |         struct cord *cord = (struct cord *)calloc(sizeof(struct cord), 1);
      ```
      
      NO_TEST=build fix
      NO_CHANGELOG=build fix
      NO_DOC=build fix
      6da92ae2
  22. Jul 03, 2024
  23. Jul 01, 2024
    • Denis Smirnov's avatar
      refactor!: replace sql_prepare with sql_prepare_ext symbol · ea85a1ed
      Denis Smirnov authored
      BREAKING CHANGE!:
      1. remove sql_prepare from the export list;
      2. introduce sql_prepare_ext.
      
      The sql_prepare symbol previously included the tarantool port as
      an output parameter. However, this structure was inconvenient for
      libraries using the C API, as they primarily required just the
      statement ID. To address this issue, the sql_prepare symbol was
      replaced with the sql_prepare_ext symbol.
      
      NO_DOC=picodata internal patch
      NO_CHANGELOG=picodata internal patch
      2.11.2.135
      ea85a1ed
    • Denis Smirnov's avatar
      feat: share prepared statements among sessions · 65d18f29
      Denis Smirnov authored
      Previously, users with multiple connections to tarantool instance
      couldn't share prepared statements across sessions. They had to
      manually call prepare in each session before execution.
      
      This commit automates this process for the exported version of
      SQL prepared statement execution (sql_execute_prepared_ext symbol).
      Original Lua execution keeps the old behavior for backward
      compatibility.
      
      NO_DOC=picodata internal patch
      NO_CHANGELOG=picodata internal patch
      NO_TEST=picodata internal patch
      65d18f29
Loading