Skip to content
Snippets Groups Projects
  1. Aug 01, 2022
    • Andrey Saranchin's avatar
      fiber: allow to reset fiber slice with SIGURG · 1a3b710d
      Andrey Saranchin authored
      The patch introduces opportunity for user to reset
      slice of current fiber execution. It allows to limit
      iteration in space with SIGURG.
      
      NO_CHANGELOG=see later commits
      NO_DOC=see later commits
      1a3b710d
    • Andrey Saranchin's avatar
      box: allow to limit space iteration with timeout · bc053c55
      Andrey Saranchin authored
      Currently, there is no way to interrupt a long execution of a
      request (such as s:select(nil)). This patch introduces this
      opportunity.
      
      Box will use fiber deadline timeout as a timeout for DML usage.
      Thus, when deadline of current fiber is up, all DML requests will
      end with a particular error.
      
      Closes #6085
      
      NO_CHANGELOG=see later commits
      NO_DOC=see later commits
      bc053c55
    • Andrey Saranchin's avatar
      test: adapt tests to iteration limit · b33ea6ea
      Andrey Saranchin authored
      Part of #6085
      
      NO_TEST=no behavior changes
      NO_CHANGELOG=no behavior changes
      NO_DOC=no behavior changes
      b33ea6ea
    • Andrey Saranchin's avatar
      fiber: introduce fiber slice · e9bd2250
      Andrey Saranchin authored
      This patch introduces execution time slice for fiber. Later, we will use
      this mechanism to limit iteration in space.
      
      Part of #6085
      
      NO_CHANGELOG=see later commits
      NO_DOC=see later commits
      e9bd2250
    • Alexander Turenko's avatar
      fiber_channel: add accessor to internal functions · 395c30e8
      Alexander Turenko authored
      The Rust module [1] leans on several internal symbols. They were open in
      Tarantool 2.8 (see #2971 and #5932), but never were in the public API.
      Tarantool 2.10.0 hides the symbols and we need a way to get them back to
      use in the module.
      
      We have the following options:
      
      1. Design and expose a module API for fiber channels.
      2. Export the symbols with a prefix like `tnt_internal_` (to don't spoil
         the global namespace).
      3. Provide a `dlsym()` alike function to get an address of an internal
         symbol for users who knows what they're doing.
      
      I think that the third way offers the best compromise between amount of
      effort, quality of the result and opportunities to extend. In this
      commit I hardcoded the list of functions to make the change as safe as
      possible. Later I'll return here to autogenerate the list.
      
      Exported the following function from the tarantool executable:
      
      ```c
      void *
      tnt_internal_symbol(const char *name);
      ```
      
      I don't add it into the module API headers, because the function is to
      perform a dark magic and we don't suggest it for users.
      
      While I'm here, added `static` to a couple of fiber channel functions,
      which are only used within the compilation unit.
      
      [1]: https://github.com/picodata/tarantool-module
      
      Part of #7228
      Related to #6372
      
      NO_DOC=don't advertize the dangerous API
      NO_CHANGELOG=don't advertize the dangerous API
      395c30e8
  2. Jul 29, 2022
  3. Jul 27, 2022
    • Ilya Verbin's avatar
      box: fix thread_id check in box.stat.net.thread[] · 969b76ac
      Ilya Verbin authored
      The valid range for thread_id is [0, iproto_threads_count - 1].
      
      Closes #7196
      
      NO_DOC=bugfix
      969b76ac
    • Igor Munkin's avatar
      ci: make LuaJIT integration workflow rerunnable · 7a41bc9b
      Igor Munkin authored
      
      If Tarantool tests fail in LuaJIT integration workflow used in
      tarantool/luajit repository and LuaJIT submodule is already bumped in
      tarantool/tarantool repository, one can't rerun the failed job since
      "LuaJIT bump" step brings down the whole pipeline with "nothing to
      commit" reason.
      
      There are still many flaky tests, so to make this integration workflow
      rerunnable from tarantool/luajit repository --allow-empty option is
      added to the git commit command.
      
      NO_DOC=ci
      NO_TEST=ci
      NO_CHANGELOG=ci
      
      Reviewed-by: default avatarYaroslav Lobankov <y.lobankov@tarantool.org>
      Reviewed-by: default avatarSergey Kaplun <skaplun@tarantool.org>
      Signed-off-by: default avatarIgor Munkin <imun@tarantool.org>
      7a41bc9b
    • Ilya Verbin's avatar
      box: check for foreign keys on space:truncate() · 7ec71b4f
      Ilya Verbin authored
      Add a missed check to on_replace_dd_truncate, similar to
      on_replace_dd_space and on_replace_dd_index.
      
      Closes #7309
      
      NO_DOC=bugfix
      7ec71b4f
    • Igor Munkin's avatar
      luajit: bump new version · 3214fa04
      Igor Munkin authored
      * test: make sysprof tests more deterministic
      * test: increase sampling interval in sysprof tests
      * LJ_GC64: Fix IR_VARG offset for fixed number of results.
      * sysprof: implement stack sandwich support
      * symtab: fix .symtab section dump of the executable
      * sysprof: disable proto and trace dumps in default
      * ci: introduce GitHub action for environment setup
      * build: configure parallel jobs
      * ci: replace hw.ncpu with hw.logicalcpu for macOS
      * ci: add Tarantool integration testing
      * ci: remove GC64 matrix entries for ARM64 workflows
      * ci: fix --parallel argument for MacOS runners
      
      Closes #7172
      Closes #7244
      Closes #7264
      Part of #7230
      Needed for #7472
      
      NO_DOC=LuaJIT submodule bump
      NO_TEST=LuaJIT submodule bump
      3214fa04
    • Andrey Saranchin's avatar
      core: introduce helper tt_sigaction · 9839812c
      Andrey Saranchin authored
      The problem is that even if we block all signals on all
      threads except the main thread, the signals still can be
      delivered to other threads (#7206). And another problem
      is that user can spawn his own thread and not block
      signals.
      
      That is why the patch introduces tt_sigaction function that
      guarantees that all signals will be handled only by the main
      thread. We use this helper in clock_lowres module.
      This is supposed to solve the problem, described in #7408.
      
      NO_CHANGELOG=internal
      NO_DOC=internal
      9839812c
    • Andrey Saranchin's avatar
      crash: do not use fiber() macro in crash_collect() · 277b70b5
      Andrey Saranchin authored
      Currently, tarantool uses fiber() macro in crash_collect()
      to collect backtraces, which is redundant and leads to
      NULL dereferencing if crash signal callback is executed
      on thread with no initialized cord.
      
      The patch makes it possible not to use fiber module for
      collecting backtraces and gets rid of fiber() macro
      in crash_collect().
      
      NO_CHANGELOG=internal
      NO_TEST=internal
      NO_DOC=internal
      277b70b5
  4. Jul 26, 2022
    • Alexander Turenko's avatar
      tuple: add JSON path field accessor to module API · bcca0b2b
      Alexander Turenko authored
      Added a function (see the API in the documentation request below), which
      reflects the `tuple[json_path]` Lua API (see #1285).
      
      Part of #7228
      
      @TarantoolBot document
      Title: tuple: access a field using JSON path via module API
      
      The following function is added into the module API:
      
      ```c
      /**
       * Return a raw tuple field in the MsgPack format pointed by
       * a JSON path.
       *
       * The JSON path includes the outmost field. For example, "c" in
       * ["a", ["b", "c"], "d"] can be accessed using "[2][2]" path (if
       * index_base is 1, as in Lua). If index_base is set to 0, the
       * same field will be pointed by the "[1][1]" path.
       *
       * The first JSON path token may be a field name if the tuple
       * has associated format with named fields. A field of a nested
       * map can be accessed in the same way: "foo.bar" or ".foo.bar".
       *
       * The return value is valid until the tuple is destroyed, see
       * box_tuple_ref().
       *
       * Return NULL if the field does not exist or if the JSON path is
       * malformed or invalid. Multikey JSON path token [*] is treated
       * as invalid in this context.
       *
       * \param tuple a tuple
       * \param path a JSON path
       * \param path_len a length of @a path
       * \param index_base 0 if array element indexes in @a path are
       *        zero-based (like in C) or 1 if they're one-based (like
       *        in Lua)
       * \retval a pointer to a field data if the field exists or NULL
       */
      API_EXPORT const char *
      box_tuple_field_by_path(box_tuple_t *tuple, const char *path,
      			uint32_t path_len, int index_base);
      ```
      bcca0b2b
    • Alexander Turenko's avatar
      tuple: add index base to JSON path accessors · 75f470cf
      Alexander Turenko authored
      It is preparatory change to expose the `box_tuple_field_by_path()`
      function into the module API. A user should have ability to choose
      zero-based (as in C) or one-based (as in Lua) array element selectors.
      This commit adds the `index_base` parameter into several internal
      functions, which access a field using a JSON path.
      
      Part of #7228
      
      NO_DOC=refactoring, no user-visible changes
      NO_TEST=will be tested in a next commit implicitly by
              box_tuple_field_by_path() test cases
      NO_CHANGELOG=refactoring, no user-visible changes
      75f470cf
    • Nick Volynkin's avatar
      ci: remove tests for Ubuntu Impish (21.10) · a3423f3d
      Nick Volynkin authored
      Ubuntu Impish Indri (21.10) has reached end of life
      (https://wiki.ubuntu.com/Releases). There will be
      no further releases of Tarantool for Ubuntu 21.10,
      hence there's no need to run tests and check
      packaging.
      
      NO_TEST=ci
      NO_DOC=ci
      
      Resolves tarantool/tarantool-qa#257
      a3423f3d
  5. Jul 25, 2022
    • Ilya Verbin's avatar
      box: return 1-based fkey field numbers to Lua · 014f5aa1
      Ilya Verbin authored
      In Lua field's numbers are counted from base 1, however currently
      space:format() and space.foreign_key return zero-based foreign key
      fields, which leads to an error on space:format(space:format()).
      
      Closes #7350
      
      NO_DOC=bugfix
      014f5aa1
    • Ilya Verbin's avatar
      box: do not modify format arg by normalize_format · a8b6fd0c
      Ilya Verbin authored
      Currently a foreign_key field in the `format` argument, passed to
      normalize_format, can be changed inside normalize_foreign_key_one.
      Fix this by using a local copy of def.field.
      
      NO_DOC=bugfix
      NO_CHANGELOG=minor bug
      a8b6fd0c
  6. Jul 22, 2022
  7. Jul 21, 2022
    • Ilya Verbin's avatar
      box: drop space_id for FK referring to same space · f21f8e90
      Ilya Verbin authored
      It is inconvenient to create self-referencing FK constraints, as the
      space ID will only be generated during space creation. This is
      especially useful for SQL, since the format for the space is created
      at compile time, and the space ID is only obtained at run time.
      
      Closes #7200
      
      @TarantoolBot document
      Title: Describe foreign keys referring to the same space
      Since: 2.11
      Root document: https://www.tarantool.io/en/doc/latest/book/box/data_model/#foreign-keys
      
      It is possible to create a foreign key that refers to the same space (a
      child space equals to the parent space).
      To do that, omit `space` in the `foreign_key` parameter, or set it to
      the id or to the name of the current space.
      f21f8e90
    • Boris Stepanenko's avatar
      test: fix execpl call in unit/coio test · 7c434166
      Boris Stepanenko authored
      According to man 3 exec: "The first argument, by convention, should point
      to the filename associated with the file being executed.". Using empty
      string as the first argument while calling `true` program, provided by
      coreutils led to error message being printed to stderr, which failed the
      test.
      
      This patch passes 'true' as the first argument.
      
      Closes #7452.
      
      NO_DOC=test
      NO_CHANGELOG=test
      7c434166
    • Nikita Zheleztsov's avatar
      net.box: add checking of options · d7da59b4
      Nikita Zheleztsov authored
      Currently net.box's methods doesn't check types of passed options.
      This can lead to Lua's internal errors, which are not self-explaining.
      
      Let's add this functionality and raise errors with meaningful messages
      in case of incorrect options.
      
      Closes #6063
      Closes #6530
      
      NO_DOC=Not a visible change
      d7da59b4
    • Nikita Zheleztsov's avatar
      test: refactor gh_6305_net_box_autocomplete · a5179846
      Nikita Zheleztsov authored
      Test is needed to be updated every time net.box's internals are patched
      (e.g. in case of adding new functions of deleting old ones), as the order
      of suggested autocomplete options changes.
      
      Let's replace `assert_equals` with `assert_items_equals`, which is not
      order dependent.
      
      NO_DOC=test
      NO_CHANGELOG=test
      a5179846
  8. Jul 19, 2022
    • Yaroslav Lobankov's avatar
      ci: support parallel cmake build in `test-jepsen` · 58ea8b5e
      Yaroslav Lobankov authored
      In order to support parallel cmake build in the `test-jepsen` target
      we need to run Jepsen testing in a `debian-buster` container instead
      of `debian-stretch` due to the old `cmake` version in it. The `cmake`
      utility started to support `--parallel` option since 3.12 version [1].
      
      In Debian Stretch `cmake` has version 3.7.
      In Debian Buster `cmake` has version 3.13.
      
      [1] https://cmake.org/cmake/help/latest/release/3.12.html#command-line
      
      NO_DOC=ci
      NO_TEST=ci
      NO_CHANGELOG=ci
      58ea8b5e
    • Yaroslav Lobankov's avatar
      ci: rm old mentions about .travis.mk in comments · 78a04083
      Yaroslav Lobankov authored
      A note for the `.gitlab.mk` makefile:
      
      Mentions about `.travis.mk` in `.gitlab.mk` file will be removed in
      the scope of refactoring it later.
      
      NO_DOC=ci
      NO_TEST=ci
      NO_CHANGELOG=ci
      78a04083
    • Yaroslav Lobankov's avatar
      ci: drop .travis.mk makefile in favour of .test.mk · 316fc1db
      Yaroslav Lobankov authored
      Now it's time to drop the `.travis.mk` makefile because `.test.mk` has
      fully replaced it.
      
      NO_DOC=ci
      NO_TEST=ci
      NO_CHANGELOG=ci
      316fc1db
    • Yaroslav Lobankov's avatar
      ci: use targets from .test.mk in workflows · 95b4dd07
      Yaroslav Lobankov authored
      A note for arm64 OSX workflows:
      
      The `arch -arm64` command prior to calling the makefile was omitted
      because now the GitHub Actions agent has a build for arm64 machines.
      Hence the agent is able to run without Rosetta 2 binary translator.
      
      NO_DOC=ci
      NO_TEST=ci
      NO_CHANGELOG=ci
      95b4dd07
    • Yaroslav Lobankov's avatar
      ci: add actions with installing build/test deps · 0dbdd420
      Yaroslav Lobankov authored
      This patch adds actions with installing deps for Debian, FreeBSD, and
      OSX operation systems. Also, it adds an action with installing deps for
      Jepsen testing. Debian, FreeBSD, and OSX actions should be used before
      running tests on the corresponding operation systems. Jepsen action
      should be used before running Jepsen tests.
      
      Reasoning:
      
      1. The makefile w/o targets with deps installation is OS-independent.
         It should work on all systems.
      
      2. Deps installation is more about env preparation rather than building
         and testing. Moreover, it is OS-dependent. So it's logical to take it
         outside the makefile into a GitHub action.
      
      3. If we need testing on other operation systems, for example, CentOS,
         we will just create a special action with deps installation for that.
         No changes for the makefile will be needed. All should work out of
         the box.
      
      NO_DOC=ci
      NO_TEST=ci
      NO_CHANGELOG=ci
      0dbdd420
    • Yaroslav Lobankov's avatar
      ci: introduce .test.mk instead of .travis.mk · cbaf71ed
      Yaroslav Lobankov authored
      This patch introduces the new test makefile `.test.mk` instead of the
      ancient `.travis.mk`. The `.test.mk` file is a fully reworked version of
      `.travis.mk` with the huge refactoring and contains only those targets
      that are indeed used.
      
      NO_DOC=ci
      NO_TEST=ci
      NO_CHANGELOG=ci
      cbaf71ed
    • Timur Safin's avatar
      datetime: datetime_unpack test · 07eaf61a
      Timur Safin authored
      Created simplistic unit test for checking boundary conditions
      for `datetime_unpack` function.
      
      NO_DOC=internal
      NO_CHANGELOG=internal
      07eaf61a
    • Timur Safin's avatar
      datetime: fuzzer for messagepuck decoder · 9bc2a20f
      Timur Safin authored
      Introduced fuzzing testing for datetime decoder.
      
      NO_DOC=internal
      NO_CHANGELOG=internal
      9bc2a20f
    • Timur Safin's avatar
      datetime: validate unpacked data · fda1f6f5
      Timur Safin authored
      Introduced few checks of validity of incoming data
      at the moment messagepack is converted to datetime.
      
      - we check that size is either big enough for single
        epoch or whole record;
      - and we check range of data in decoded fields.
      
      Fixes #6723
      
      NO_DOC=bugfix
      NO_TEST=see the other commit for fuzzer
      fda1f6f5
    • Timur Safin's avatar
      datetime: refactor NANOS_PER_SEC · 9efc75b8
      Timur Safin authored
      NO_DOC=refactoring
      NO_CHANGELOG=refactoring
      9efc75b8
    • Rianov Viacheslav's avatar
      lua: fix sigint behavior in multiline input mode · e8abbcbc
      Rianov Viacheslav authored
      This patch fixes the ctrl+c behavior in multiline mode.
      The old behavior was ignoring sigint in this mode.
      The new behavior is quitting this mode and printing the new
      default prompt.
      Added a new test for covering the mentioned case.
      
      Follows up #2717
      Closes #7109
      
      NO_DOC=BUGFIX
      e8abbcbc
  9. Jul 15, 2022
    • Vladimir Davydov's avatar
      memtx: refactor tuple read view API · b87ef00b
      Vladimir Davydov authored
      This commit replaces enter/leave_delayed_free_mode() MemtxAllocator
      methods with open/close_read_view(). The open_read_view() method
      returns a pointer to the new read view, which is supposed to be pssed
      to close_read_view() when the read view is no longer needed. The new
      API will allow us to optimize garbage collection, see #7185.
      
      Currently, open_read_view() always returns nullptr and both ReadView
      and memtx_read_view_opts are empty structs. We will extend them in
      the future.
      
      Closes #7364
      
      NO_DOC=refactoring
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      b87ef00b
    • Vladimir Davydov's avatar
      trivia: add std::get by type · ebf71a35
      Vladimir Davydov authored
      std::get by type is unavailable in C++11. Implement our own version.
      Let's name it util::get and put it in trivia/tuple.h.
      
      NO_DOC=internal
      NO_TEST=internal
      NO_CHANGELOG=internal
      ebf71a35
    • Vladimir Davydov's avatar
      memtx: use stailq instead of lifo for tuple garbage collection list · 3ddb5920
      Vladimir Davydov authored
      To immediately delete tuples that were allocated before a read view was
      created, but are not visible from the read view (see #7185), we will
      need to store them in per-read view garbage collection lists. We will
      also need to merge those lists. With lifo, merging is impossible. Let's
      switch to stailq, which allows this operation (see stailq_concat).
      
      Note, since the min value of box.cfg.slab_alloc_granularity is 4, we
      align memtx_tuple by 4 bytes.
      
      Needed for #7185
      
      NO_DOC=refactoring
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      3ddb5920
Loading