Skip to content
Snippets Groups Projects
  1. Dec 16, 2021
    • Mergen Imeev's avatar
      sql: introduce binding for MAP · b6a08c5c
      Mergen Imeev authored
      After this patch, MAP values can be used as bind variables. However, due
      to the current syntax for binding in Lua, the only possible way is to
      use MAP values as the named bind variable.
      
      Part of #4763
      b6a08c5c
    • Mergen Imeev's avatar
      sql: introduce binding for ARRAY · befcbd21
      Mergen Imeev authored
      After this patch, ARRAY values can be used as bind variables. However,
      due to the current syntax for binding in Lua, the only possible way is
      to use ARRAY values as the named bind variable.
      
      Part of #4762
      befcbd21
  2. Dec 14, 2021
    • Alexander Turenko's avatar
      ci: add linter job for changelog entries · 8b1ce351
      Alexander Turenko authored
      What is bad: a considerable amount of boilerplate code should be added
      to just run a simple script. I hope we'll do something with this
      in #6604.
      8b1ce351
    • Alexander Turenko's avatar
      doc: fix several typos in changelog entries · 5b6a2b95
      Alexander Turenko authored
      After this change the release notes are able to be built.
      
      Changed '---' to '----', so comments for a release manager are parsed
      correctly.
      5b6a2b95
    • Alexander Turenko's avatar
      ci: rename luacheck.yml to lint.yml · f0980af8
      Alexander Turenko authored
      The idea is to allow to add more checks here: I'm going to add
      changelogs check in a next commit.
      f0980af8
    • Vladimir Davydov's avatar
      cmake: allow to set arbitrary version · 8509f163
      Vladimir Davydov authored
      This commit allows to override Tarantool version detection by setting
      CMake TARANTOOL_VERSION variable. This is needed to build Tarantool as a
      part of tarantool/sdk, which sets its own, extended version.
      
      Also, this commit updates box-py/args.test.py to allow arbitrary tags
      appended to the version (tarantool/sdk appends -rNNN).
      8509f163
    • Vladimir Davydov's avatar
      cmake: drop auto-update of submodules · 79f531c9
      Vladimir Davydov authored
      Submodules are auto-updated in two cases:
      1. When cmake is called for the first time (and there's no
         src/lib/small/CMakeLists.txt).
      2. If git-describe version doesn't match the version stored in the
         VERSION file.
      
      The first case looks okay, but the second one is confusing. It means
      that the following sequence of commands does NOT update submodules:
      
      ```sh
      cmake . # initial configuration, fetches small
      cd src/lib/small && git checkout HEAD^ && cd - # checkout small
      cmake . # does NOT update small
      ```
      
      while the following sequence of commands does:
      
      ```sh
      git commit --allow-empty -m dummy
      cmake . # updates small!
      ```
      
      This looks confusing, inconsistent, and dangerous. Let's drop this code
      and let the developers update submodules manually when they need to.
      
      This effectively reverts commit c83eea60
      ("CMake: automatically update submodules").
      79f531c9
    • Vladimir Davydov's avatar
      cmake: take git version from main project · c7546efe
      Vladimir Davydov authored
      Use git from CMAKE_SOURCE_DIR instead of PROJECT_SOURCE_DIR so that if
      Tarantool is built as a sub-project, we will use the version of the main
      project.
      c7546efe
    • Vladimir Davydov's avatar
      Add audit log implementation stub · 3f3bb245
      Vladimir Davydov authored
      To build audit log as a part of the box library, set the following cmake
      variables:
       - ENABLE_AUDIT_LOG: ON
       - AUDIT_LOG_SOURCES: audit log source files
       - EXTRA_BOX_INCLUDE_DIRS: header files needed for compilation
      
      and add "audit_impl.h" to EXTRA_BOX_INCLUDE_DIRS - then it will be
      included by "audit.h".
      
      If ENABLE_AUDIT_LOG is unset, then a stub implementation is built, which
      spits a warning to the log on an attempt to configure audit log.
      3f3bb245
    • Vladimir Davydov's avatar
      test: remove {grep,wait}_log limit in some tests · 4ebdd8c0
      Vladimir Davydov authored
      Needed for the tests to pass with enabled audit log.
      4ebdd8c0
  3. Dec 13, 2021
    • Aleksandr Lyapunov's avatar
      lib: use memcpy for unaligned load/store · 7b40dcce
      Aleksandr Lyapunov authored
      Now there's a lot of load_*/store_* functions that are designed
      for unaligned access to values in data stream. Unfortunately
      they are written in a way that makes new compilers to warn about
      outside bounds.
      
      Rewrite it in the most safe, cross-platform and efficient way -
      using memcpy. Note that memcpy with compile-time-defined size is
      recognized by the magority of compilers and they make the most
      efficient operation.
      
      Closes #6703
      7b40dcce
    • Vladimir Davydov's avatar
      Make lookup of statically built binary more robust · 88332b35
      Vladimir Davydov authored
      If the tarantool repository is used as a submodule named <foobar> in
      another repository, then the statically built binary will be placed in
      
        <binary_dir>/<foobar>/src/tarantool
      
      not in
      
        <binary_dir>/src/tarantool
      
      where static-build/CMakeLists.txt currently tries to look it up in order
      to run `ctest` and so we can't use static-build/CMakeLists.txt as is.
      
      Let's instead use
      
        <install_dir>/bin/tarantool
      
      This way `ctest` will work for static-build in both open-source and EE
      repository without requiring any modifications.
      88332b35
    • Alexander Turenko's avatar
      ci: run the whole test suite in debug_aarch64 job · c7fd1d95
      Alexander Turenko authored
      We anyway run all tests on graviton machines in centos_{7,8}_aarch64 and
      fedora_{33,34}_aarch64 jobs.
      c7fd1d95
    • Alexander Turenko's avatar
      ci: bump actions/checkout from v1 to v2.3.4 · 0ae7e209
      Alexander Turenko authored
      Regarding debug_aarch64: we had old git on odroid machines (see
      PR #6180), but now we use graviton ones and, it seems, it becomes
      irrelevant.
      
      Regarding memtx_allocator_based_on_malloc: it seems, checkout@v1 here is
      due to usage of Debian Stretch (with git 2.11) in docker, as in older
      release workflow. Updated it in the spirit of PR #5949.
      
      Left actions/checkout@v1 in containers jobs (coverity and jepsen*): it
      should be revisited separately.
      
      Left actions/checkout@v1 in perf_* jobs: they run on special machines
      and I don't want to dig inside this part of the infrastructure ATM.
      0ae7e209
    • Alexander Turenko's avatar
      ci: drop useless chown call · a0a2e8b9
      Alexander Turenko authored
      AFAIK we anyway run self-hosted runners from root due to all those
      problems like [1]. No reason to include the hack into every workflow
      file. If we'll going to start runners from a non-root user, it is better
      to pass `--user $PROPER_UID` to all docker jobs instead, see [2]: at
      least it does not require to place a boilerplate into all workflow
      files.
      
      Didn't touch perf_* jobs: don't want to dig inside this part of the
      infrastructure ATM.
      
      It reverts PR #5953.
      
      [1]: https://github.com/actions/checkout/issues/211
      [2]: https://github.com/actions/runner/issues/691
      a0a2e8b9
    • Alexander Turenko's avatar
      ci: drop useless fail-fast clause · 474d1cc2
      Alexander Turenko authored
      AFAIU it only has meaning for jobs constructed with matrix expansion.
      See the documentation: [1].
      
      It is relevant to [2] as well, but already fixed on nektos/act side.
      
      [1]: https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idstrategyfail-fast
      [2]: https://github.com/tarantool/tarantool-qa/issues/118
      474d1cc2
    • Timur Safin's avatar
      test: fix flaky app-tap/datetime.test.lua · cf2c463e
      Timur Safin authored
      Workaround for #6599 where we may randomly fail on AWS Graviton machines,
      while it's working properly when jit disabled.
      
      Follow-up to #5941
      Relates to #6599
      cf2c463e
    • VitaliyaIoffe's avatar
      github-ci: delete option in Odroid debug workflow · c1b22724
      VitaliyaIoffe authored
      There was a build problem with CMAKE_BUILD_TYPE=Debug build on ARM64. It
       was fixed in 224cb68c (build: fix
       build on Linux ARM64 with CMAKE_BUILD_TYPE=Debug), before this fix
       '-DCMAKE_C_FLAGS="-Wno-type-limits "' was used to avoid the issue,
       implemented by 72c77166 (github-ci:
       add GitHub Actions workflow for Odroid).
      
      Follow-up #6143
      c1b22724
    • Andrey Kulikov's avatar
      debian: eliminate dependency from binutils package · a86f5963
      Andrey Kulikov authored
      tarantool debian package MUST NOT depends on binutils package. This is
      due to the fact that binutils include linker and assembler, what in most
      cases forbidden on production servers.
      
      This dependency is a residual from times, when tarantool did use libbfd
      for stack unwinding. Now it simply does not required at all.
      
      Fixes #6699
      a86f5963
    • mechanik20051988's avatar
      box: implement ability to pass several URIs in different ways · 4d10e252
      mechanik20051988 authored
      Previously, for "listen" and "replication" options URI can be passed
      as a number, as a string value or as a table, which contains numbers
      and strings, no special properties for URIs was available. Now user
      can pass URIs in different ways, same as in tarantool "uri" library:
      as before, as a table which contains URI and it's parameters in "param"
      table, as a table which contains URI strings and URI tables. Same
      as in "uri" library, which internally used to parse new "listen" and
      "replication" there are different ways to specify properties for URI:
      in a string which contains URI, after '?' delimiter, in a table which
      contains URI in "params" table, in "default_params" table if it is
      default parameters for all URIs.
      
      Closes #5928
      
      @TarantoolBot document
      Title: implement ability to pass several URIs in different ways
      Now there are several ways to pass multiple URIs for box.cfg.listen
      and box.cfg.replication:
      ```lua
      -- As a string with one or several URIs separated by commas
      -- (provides backward compatibility):
      box.cfg { listen = "127.0.0.1:3301, /unix.sock, 3302" }
      -- As an array which contains string URIs (unambiguous short form):
      box.cfg { listen = {"127.0.0.1:3301", "/unix.sock", "3302"} }
      -- As an array of tables with 'uri' field
      -- (may be extended with more fields in future):
      box.cfg {  listen = {
              {uri = "127.0.0.1:3301"},
              {uri = "/unix.sock"},
              {uri = 3302}
          }
      }
      ```
      4d10e252
    • mechanik20051988's avatar
      uri: implement ability to parse URIs passed in different ways · 37c35677
      mechanik20051988 authored
      Previously, URI can be passed as a string, which contains one URI
      or several URIs separated by commas. Now URIs can be passed in
      different ways: as before, as a table which contains URI and it's
      parameters in "param" table, as a table which contains URI strings
      and URI tables. Also there are different ways to specify properties
      for URI: in a string which contains URI, after '?' delimiter, in a
      table which contains URI in "params" table, in "default_params" table
      if it is default parameters for all URIs.
      For this purposes new method `parse_many` was implemented in tarantool
      `uri` library. Also `parse` method was updated to make possible the
      same as new `parse_many` method but only for single URI.
      ```lua
      uri = require('uri')
      -- Single URI, passed as before
      uri.parse_many("/tmp/unix.sock")
      -- Single URI, with query paramters
      uri.parse_many("/tmp/unix.sock?q1=v1&q2=v2")
      -- Several URIs with parameters in one string, separated by commas
      uri.parse_many("/tmp/unix.sock_1?q=v, /tmp/unix.sock_2?q=v")
      -- Single URI passed in table, with additional parameters, passed
      -- in "params" table. This parameters overwrite parameters from
      -- URI string (q1 = "v2" in example below).
      uri.parse_many({"/tmp/unix.sock?q1=v1", params = {q1 = "v2"}})
      -- For parse it's also works now
      uri.parse({"/tmp/unix.sock?q1=v1", params = {q1 = "v2"}})
      -- Several URIs passed in table with default parameters, passed
      -- in "default_params" table, which are used for parameters, which
      -- not specified for URI (q3 parameter with "v3" value corresponds
      -- to all URIs, and used if there is no such parameter in URI).
      uri.parse_many({
          "/tmp/unix.sock_1?q1=v1",
          { uri = "/tmp/unix.sock_2", params = { q2 = "v2" } },
          default_params = { q3 = "v3" }
      })
      ```
      37c35677
    • mechanik20051988's avatar
      uri: implement ability to parse several URIs · 3661bc3a
      mechanik20051988 authored
      Implement ability to parse a string, which contains several URIs
      separated by commas. Each URI can contain different query parameters
      after '?'. All created URIs saved in new implemented struct `uri_set`.
      
      Part of #5928
      3661bc3a
    • mechanik20051988's avatar
      uri: implement ability to parse URI query paramters · 27cef5c8
      mechanik20051988 authored
      Previously, the part of the URI string that comes after the first '?' was
      saved as a single unit in the field `query` as a part of `struct uri`. Now
      an array of URI paramters has been added to the uri structure, and query is
      subjected to the additional parsing and URI query parameters are extracted
      from it. The separator symbol between URI query parameters is '&', the
      separator symbol between parameter and it's value is '='. For example
      URI = "/tmp/unix.sock?q1=v11&q1=v12&q2=v2" has two parameters: parameter
      'q1' with two values 'v11' and 'v12' and parameter 'q2' with value 'v2'.
      
      Part of #5928
      Closes #1175
      27cef5c8
    • mechanik20051988's avatar
      uri: rework struct uri to use a copy of the original splitted string. · c65fd012
      mechanik20051988 authored
      In the future, it is planned to extend the URI structure to allow its
      passing with different options and in different formats (see next commit
      `uri: implement ability to parse URI query paramters` for example). For
      these purposes, it is planned to use functions that modify the source
      string, for example `strtok_r`, so we need to rework the URI structure
      to create copies of the string for each of the URI components.
      
      Part of #5928
      c65fd012
    • mechanik20051988's avatar
      uri: rename uri.* to uri_parser.* · 0765828e
      mechanik20051988 authored
      In the next commit we implement new `struct uri` and
      rename current `struct uri` to `struct uri_raw` which
      will be located in uri_parser.* files. Since git does
      not understand that we renamed file, if in the same
      commit we create file with the same name that file had
      before renaming, we will perform the renaming in a
      separate commit.
      
      Part of #5928
      0765828e
    • mechanik20051988's avatar
      uri: fix incorrect parse of unix socket URI with query · a54da468
      mechanik20051988 authored
      Previously in case when unix socket URI with query didn't
      contain "unix/:" prefix, parsing of this URI was incorrect.
      For example "/unix.sock?q=v" was parsed into "path: /unix.sock"
      and "query: x=y" instead of "host: unix/", "service: /unix.sock",
      "unix: /unix.sock" and "query: x=y". Now parsing of unix socket
      URI is independent from "unix/:" prefix and correct.
      Pay attention, all parsing logic is realized in uri.rl file which
      compiled in uri.c using 'ragel'.
      
      Part of #5928
      a54da468
    • mechanik20051988's avatar
      test: little fixes to make error message if test fails more clear · 2a40dada
      mechanik20051988 authored
      The third parameter passed to the 'test:is' function is a message
      and usually should described what test checked.
      2a40dada
  4. Dec 10, 2021
    • Andrey Saranchin's avatar
      memtx: raise an error if argument of select() is a "clear" dict · a281c742
      Andrey Saranchin authored
      Currently, select/pairs/get look at an :array part of passed table,
      that is why different problems occurs when passed to select() table
      is not a regular array.
      
      Now we will check if passed table is not "clear dict"
      (not empty table without array part). Invalid queries
      like s:select{key = 'value'} will fail with an appropriate
      error, but the problems with dicts containing array part
      still remain (for example, s:select{1, key = 'value'} is
      the same as s:select{1}).
      
      Closes #6167
      a281c742
    • Vladimir Davydov's avatar
      cmake: embed luarocks in static build · 0315c2db
      Vladimir Davydov authored
      Without it `tarantoolctl rocks` would require luarocks to be installed
      on the system, which isn't always possible.
      0315c2db
    • Vladimir Davydov's avatar
      cmake: add prefix to symbol names used for jit lua modules · 74e8c968
      Vladimir Davydov authored
      To avoid possible name clashes: e.g. we might want to add a module
      'dump' to the built-in lib, but the symbol name dump_lua is already
      taken for 'jit.dump' - so better rename dump_lua to jit_dump_lua.
      74e8c968
    • Vladimir Davydov's avatar
      cmake: pass symbol name explicitly to lua_source and bin_source · f5a7bb42
      Vladimir Davydov authored
      Currently, the symbol name is deducted from the filename, but it may
      lead to name clashes if different packages have modules with same names.
      Let's pass the symbol name explicitly to avoid that.
      
      This is needed to embed luarocks in static build.
      f5a7bb42
    • Vladimir Davydov's avatar
      cmake: embed lua-zlib in static build · 78ac485a
      Vladimir Davydov authored
      This is needed to embed luarocks in static build.
      78ac485a
    • Vladimir Davydov's avatar
      cmake: factor out FindZLIB · 4bd44330
      Vladimir Davydov authored
      Zlib is used in OpenSSL and in libCURL. Besides, we will need it for
      lua-zlib. So better define FindZLIB.
      
      Note, `add_library(ZLIB::ZLIB UNKNOWN IMPORTED)` and setting the
      corresponding properties in FindZLIB.cmake is needed to build libcurl,
      which depends on zlib.
      4bd44330
  5. Dec 09, 2021
  6. Dec 08, 2021
    • Vladislav Shpilevoy's avatar
      test: fix flaky read_only_reason test · e7f1e2fe
      Vladislav Shpilevoy authored
      This is a second attempt to stabilize #5568 test since
      5105c2d7 ("test: fix flaky
      read_only_reason test").
      
      It had several failures with various frequency.
      
      * test_read_only_reason_synchro() could see ro_reason as nil even
        after box.error.READONLY was raised (and some yields passed);
      
      * test_read_only_reason_orphan() could do the same;
      
      * `box.ctl.demote()` could raise error "box.ctl.demote does not
        support simultaneous invocations".
      
      The orphan failure couldn't be reproduced. It was caught only
      locally, so maybe it was just some unnoticed diff breaking the
      test.
      
      Failure of test_read_only_reason_synchro() could happen when
      demote() was called in a previous test case, then the current test
      case called promote(), then got box.error.READONLY on the replica,
      then that old demote() was delivered to replica, and the attempt
      to get ro_reason returned nil. It is attempted to be fixed with
      replication_synchro_quorum = 2, so master promote()/demote() will
      implicitly push the previous operation to the replica. Via term
      bump and quorum wait.
      
      Additionally, huge replication_synchro_timeout is added for manual
      promotions. Automatic promotion is retried so here the timeout is
      not so important.
      
      `box.ctl.demote` failure due to `simultaneous invocations` seems
      to be happening because the original auto-election win didn't
      finish limbo transition yet. Hence the instance calling demote()
      now would think it is called 'simultaneously' with another
      promote()/demote().
      
      It is attempted to be fixed from 2 sides:
      
      - Add waiting for `not box.info.ro` on the leader node after
        auto-promotion. To ensure the limbo is taken by the leader;
      
      - The first option didn't help much, so `box.ctl.demote()` is
        simply called in a loop until it succeeds.
      
      Closes #6670
      e7f1e2fe
    • Alexey Vishnyakov's avatar
      swim: fix debug assertion abort in proto decode · d1a60af5
      Alexey Vishnyakov authored
      assert(cur < end) after mp_load_u8 in mp_check_binl was failing
      d1a60af5
    • Alexander Turenko's avatar
      build: fix linking of debug curl library · 6ab951fd
      Alexander Turenko authored
       | [100%] Linking C static library libcurl-d.a
       | <...>
       | make[3]: *** No rule to make target `build/curl/dest/lib/libcurl.a',
       |     needed by `test/unit/luaL_iterator.test'. Stop.
      
      The problem appears on Mac OS. It is a bit strange that we don't see it
      on Linux. However I didn't dig into this, just fixed the observed
      problem.
      
      Related: https://github.com/curl/curl/issues/2121
      
      Fixes #6656
      6ab951fd
Loading