Skip to content
Snippets Groups Projects
  1. Jun 03, 2021
    • Mergen Imeev's avatar
      sql: VARBINARY result for LUA functions · 2b25ca6c
      Mergen Imeev authored
      This patch allows VARBINARY to be returned for user-defined LUA
      functions. However, there are currently no values that can be
      interpreted as VARBINARY by the serializer, so the only way to get a
      VARBINARY result for user-defined LUA functions is to return a UUID or
      DECIMAL. Both types are not supported by SQL and are treated as
      VARBINARY.
      
      Closes #6024
      2b25ca6c
    • Mergen Imeev's avatar
      sql: VARBINARY result for C functions · b5a78ead
      Mergen Imeev authored
      This patch allows VARBINARY to be returned for user-defined C functions.
      There is currently no support for UUID and DECIMAL in SQL, so they are
      also treated as VARBINARY.
      
      Part of #6024
      b5a78ead
    • Nikita Pettik's avatar
      vinyl: don't eliminate insert+delete during index build · c5e18547
      Nikita Pettik authored
      In 0e37af31 an optimization eliminating INSERT+DELETE and DELETE+INSERT
      statements by the same key in write set was introduced. It is fine until
      it comes for secondary index build. While we are building secondary
      index we save current lsn, set on_replace trigger forwarding new
      requests to the secondary index and copy row-by-row tuples (to be more
      precise keys) to secondary index until lsn of tuple is less than the one
      we preserved at the start. Now, if during index build we execute request
      replacing key that hasn't been already transferred to secondary index,
      we will get missing key in secondary index since:
      a) In on_replace trigger replace is split into DELETE+INSERT and
         eliminated by mentioned optimization (the same concerns simple pair
         of DELETE+INSERT requests made in single transaction - so that they
         get into one write set);
      b) It is skipped in the main loop transferring tuples from PK to SK
         since lsn of modified tuples is greater than saved lsn.
      
      In this respect, we may get missing tuples in secondary index.
      The proposed solution is quite trivial: we are able to track that index
      is still being created (see previous commit) so we won't apply
      INSERT+DELETE annihilation if index build is not finished.
      
      Closes #6045
      c5e18547
    • Nikita Pettik's avatar
      vinyl: introduce vy_lsm_is_being_constructed() · eecd2b90
      Nikita Pettik authored
      It tells whether LSM tree is currently being constructed, or is already
      built and committed.
      
      Needed for #6045
      eecd2b90
  2. Jun 02, 2021
    • Vladislav Shpilevoy's avatar
      replication: check rs uuid on subscribe process · ea0b126f
      Vladislav Shpilevoy authored
      Remote node doing the subscribe might be from a different
      replicaset.
      
      Before this patch the subscribe would be retried infinitely
      because the node couldn't be found in _cluster, and the master
      assumed it must have joined to another node, and its ID should
      arrive shortly (ER_TOO_EARLY_SUBSCRIBE).
      
      The ID would never arrive, because the node belongs to another
      replicaset.
      
      The patch makes so the master checks if the peer lives in the same
      replicaset. Since it is doing a subscribe, it must have joined
      already and should have a valid replicaset UUID, regardless of
      whether it is anonymous or not.
      
      Correct behaviour is to hard cut this peer off immediately,
      without retries.
      
      Closes #6094
      Part of #5613
      ea0b126f
    • Alexander Turenko's avatar
      test: update test-run (don't clean jit.dis_arm64) · 2b107f69
      Alexander Turenko authored
      This update offers one tiny change in the pretest_clean functionaly:
      it'll not remove jit.dis_arm64 from the package.loaded table anymore.
      
      Relates to #5983
      Unverified
      2b107f69
    • Sergey Bronnikov's avatar
      extra: enable debug options for apt(8) · f40afb85
      Sergey Bronnikov authored
      Sometimes jobs on CI with Jepsen tests failed on installation
      dependencies:
      
      ```
      sudo -S -u root bash -c "cd /; env DEBIAN_FRONTEND=noninteractive apt-get install -y --force-yes apt-transport-https libzip4 ntpdate faketime"
      
      STDIN:
      null
      
      STDOUT:
      Reading package lists...
      Building dependency tree...
      Reading state information...
      
      STDERR:
      W: --force-yes is deprecated, use one of the options starting with --allow instead.
      E: Unable to locate package libzip4
      E: Unable to locate package ntpdate
      E: Unable to locate package faketime
      ```
      
      Problem looks as a flaky, I couldn't reproduce it locally.  I suspect
      the root cause is an infrastructure problem and to get more details
      about it I have enabled debug options in apt-get and added
      `set -o errexit` as it is recommended in documentation [1]
      (see Note section).
      
      1. https://www.terraform.io/docs/language/resources/provisioners/remote-exec.html#argument-reference
      
      Part of: https://github.com/tarantool/jepsen.tarantool/issues/87
      f40afb85
  3. Jun 01, 2021
    • Vladislav Shpilevoy's avatar
      qsync: handle async txns right during CONFIRM · 2a0a56ca
      Vladislav Shpilevoy authored
      It is possible that a new async transaction is added to the limbo
      when there is an in-progress CONFIRM WAL write for all the pending
      sync transactions.
      
      Then when CONFIRM WAL write is done, it might see that the limbo
      now in the first place contains an async transaction not yet
      written to WAL. A suspicious situation - on one hand the async
      transaction does not have any blocking sync txns before it and
      can be considered complete, on the other hand its WAL write is not
      done and it is not complete.
      
      Before this patch it resulted into a crash - limbo didn't consider
      the situation possible at all.
      
      Now when CONFIRM covers a not yet written async transactions, they
      are removed from the limbo and are turned to plain transactions.
      
      When their WAL write is done, they see they no more have
      TXN_WAIT_SYNC flag and don't even need to interact with the limbo.
      
      It is important to remove them from the limbo right when the
      CONFIRM is done. Because otherwise their limbo entry may be not
      removed at all when it is done on a replica. On a replica the
      limbo entries are removed only by CONFIRM/ROLLBACK/PROMOTE. If
      there would be an async transaction in the first position in the
      limbo queue, it wouldn't be deleted until next sync transaction
      appears.
      
      This replica case is not possible now though. Because all synchro
      entries on the applier are written in a blocking way. Nonetheless
      if it ever becomes non-blocking, the code should handle it ok.
      
      Closes #6057
      2a0a56ca
    • Cyrill Gorcunov's avatar
      lua/log: accept symbolic logging levels · 8494d843
      Cyrill Gorcunov authored
      
      Currently `log` module accepts only numeric values of
      logging levels. I turn `box.cfg` interface supports
      symbolic names (such as 'fatal', 'crit' and etc).
      
      Thus we should support the same in `log` module.
      
      Closes #5882
      
      Reported-by: default avatarAlexander Turenko <alexander.turenko@tarantool.org>
      Acked-by: default avatarAlexander Turenko <alexander.turenko@tarantool.org>
      Acked-by: default avatarSerge Petrenko <sergepetrenko@tarantool.org>
      Signed-off-by: default avatarCyrill Gorcunov <gorcunov@gmail.com>
      8494d843
    • Alexander V. Tikhonov's avatar
      github-ci: fix commit message for markdown · 68135b60
      Alexander V. Tikhonov authored
      Found that commit message may consists of special characters which can
      be used be Markdown as commands, like '`' or '```'. To avoid of it these
      characters must be changed to some predefined names like for:
      
      '\' - BACKSLASH
      '`' - BACKTICK
      
      Also added filter block to avoid of other not known symbols which we
      could miss. This block converts commit message to HTML and then takes
      only text from it.
      68135b60
    • Alexander V. Tikhonov's avatar
      github-ci: fix message send on rhel/fedora hosts · c19dcdc4
      Alexander V. Tikhonov authored
      Found that on self-hosted runners where CentOS 7 is the base OS,
      'send-telegram-notify' action creates message with syntax error:
      
        --------------'\n't'\n'```'\n'')) ; \
        ^
        SyntaxError: unexpected character after line continuation character
      
      It happened because of extra quotes at '\n' while it had to be \n.
      To avoid of it the same message changes must be done as for OSX
      hosts are doing. These changes should be done when self-hosted
      runners uses RHEL or Fedora as base OS.
      c19dcdc4
    • Alexander V. Tikhonov's avatar
      github-ci: set sudo for apt commands · 432edce1
      Alexander V. Tikhonov authored
      After commit:
      
        58fe0fcb ('github-ci: avoid of use container tags in actions')
      
      We began to use not the docker containers, but native github hosts.
      To avoid of permissions fails on native github actions runners apt
      command must run using sudo. Added flag '-n|--non-interactive' to
      sudo command to avoid prompting the user for input of any kind which
      could hang it. Added '-y' flag to apt update command to accept changes.
      432edce1
    • Alexander V. Tikhonov's avatar
      github-ci: port send-telegram-notify to python3 · 447775fb
      Alexander V. Tikhonov authored
      For now python3 is used as the default python on all OS and it is
      needed to enable it in send-telegram-notify action.
      
      Found issue:
      
        Traceback (most recent call last):
          File "<string>", line 3, in <module>
        AttributeError: module 'urllib' has no attribute 'quote_plus'
      
      In Python 3 quote_plus included into urllib.parse.
      
      Check documentaion [1]:
      
        Note The urllib module has been split into parts and renamed in Python 3 to urllib.request, urllib.parse, and urllib.error.
      
      Check the same issue [2].
      
      This patch changes use of all needed routines just from 'urllib'.
      
      Closes tarantool/tarantool-qa#112
      
      [1]: https://docs.python.org/2/library/urllib.html
      [2]: https://github.com/web2py/web2py/issues/1822
      447775fb
    • Serge Petrenko's avatar
      box: fix an assertion failure in box.ctl.promote() · d8964110
      Serge Petrenko authored
      box.ctl.promote() used to assume that the last synchronous entry is
      already written to WAL by the time it's called. This is not the case
      when promote is executed on the limbo owner. The last synchronous entry
      might still be en route to WAL.
      
      In order to fix the issue, wait until all the limbo entries are written
      to disk via wal_sync(). After this happens, it's safe to proceed to
      gathering quorum in promote.
      
      Closes #6032
      d8964110
    • Serge Petrenko's avatar
      box: refactor in_promote using a guard · e18b9ee6
      Serge Petrenko authored
      e18b9ee6
  4. May 29, 2021
    • Artem Starshov's avatar
      test: fix flaky tests for -e and iteractive mode · d5bd5d87
      Artem Starshov authored
      Occasionally, test/app-tap/gh-5040-inter-mode-isatty-via-errinj.test.lua
      failed because it used output file with the same name as
      test/app-tap/gh-4983-tnt-e-assert-false-hangs.test.lua and the last one
      didn't remove file after usage.
      
      Added removal of output file to test for 4983 and also changed file names
      to distinguish outputs of these tests better in case of failure.
      
      Fixes tarantool/tarantool-qa#122
      d5bd5d87
  5. May 28, 2021
  6. May 27, 2021
    • Iskander Sagitov's avatar
      fiber: set fiber->csw = 0 for every creating fiber · c7c9d420
      Iskander Sagitov authored
      It is strange to create a new fiber and see that it has yielded 100
      times, when in fact it never actually did it.
      
      The patch makes fiber->csw = 0 for each created fiber.
      
      Follow-up #5799
      c7c9d420
    • Iskander Sagitov's avatar
      fiber: introduce fiber_o:info() and fiber_o:csw() · 9da7e03e
      Iskander Sagitov authored
      If you want to get information or get csw (Context SWitch) of some fiber
      you need to call fiber.info(), but it creates table with information about
      all the fibers. This patch introduces fiber_object:info() and
      fiber_object:csw() - functions to solve this problem.
      
      Closes #5799
      
      @TarantoolBot document
      Title: introduce fiber_object:info() and fiber_object:csw()
      ```
      -- fiber_object:info() is the same as fiber.info(), but show information only
      about one alive fiber.
      -- fiber_object:csw() show csw (Context SWitch) of alive fiber.
      ```
      9da7e03e
  7. May 26, 2021
    • Mergen Imeev's avatar
      sql: replace MEM-type flags by enum mem_type · 39370f34
      Mergen Imeev authored
      This patch moves MEM types from the 'u32 flags' field to the new
      'enum mem_type type' field. Now, we can be sure that only one type is
      set for MEM. In addition, it is now easier to distinguish MAP and ARRAY
      from VARBINARY, and this makes it easier to add extension types - UUID
      and DECIMAL.
      
      Closes #4906
      39370f34
    • Mergen Imeev's avatar
      sql: make mem_is_bin() to check only for VARBINARY · 1fb46b16
      Mergen Imeev authored
      After this patch, the mem_is_bin() function will return 'true' only if
      the value that the MEM contains is of type VARBINARY. This patch also
      adds the mem_is_bin_ext() function, which is used to check if a MEM
      contains value of type VARBINARY or value of types that are currently
      considered VARBINARY extensions - MAP and ARRAY.
      
      Part of #4906
      1fb46b16
    • Mergen Imeev's avatar
      sql: initialize MEM used in aggregate functions · cddb7d2c
      Mergen Imeev authored
      This patch adds proper initialization for the MEM, which is used in the
      aggregate functions min() and max().
      
      Part of #4906
      cddb7d2c
  8. May 25, 2021
    • Vladislav Shpilevoy's avatar
      json: use cord_ibuf for encoding and decoding · 3298f129
      Vladislav Shpilevoy authored
      Lua json module used to have a global buffer for all encodings. It
      was reused by each next encode().
      
      This was not correct, because during encode() might happen a GC
      step, which might call encode() again and spoil the global buffer.
      
      The same problem was already fixed for the global static buffer in
      scope of #5632. Similarly to that time, the patch makes Lua json
      module use cord_ibuf to prevent "concurrent" usage of the buffer
      data. The global buffer is deleted.
      
      According to a few microbenchmarks it didn't affect the perf
      anyhow.
      
      Core part of the patch is strbuf changes. Firstly, its destruction
      is now optional, cord_ibuf can free itself on a next yield.
      Secondly, its reallocation algorithm is kept intact - ibuf is used
      as an allocator, not as the buffer itself. This is done so as not
      to be too intrusive in the third party module which might need an
      upgrade to the upstream in the future.
      
      Closes #6050
      3298f129
  9. May 24, 2021
    • Sergey Bronnikov's avatar
      tools: fix script to run jepsen tests · 4fea6bf8
      Sergey Bronnikov authored
      Script used to run Jepsen tests uses Terraform to prepare test environment.
      When I made this script I had a wrong assumption about working directory
      used by Terraform. Due to this sometimes job with Jepsen tests
      failed on cleanup with message:
      
      ```
      Error: Could not load plugin
      
      Plugin reinitialization required. Please run "terraform init".
      
      Plugins are external binaries that Terraform uses to access and manipulate
      resources. The configuration provided requires plugins which can't be located,
      don't satisfy the version constraints, or are otherwise incompatible.
      
      Terraform automatically discovers provider requirements from your
      configuration, including providers used in child modules. To see the
      requirements and constraints, run "terraform providers".
      
      Failed to instantiate provider
      "registry.terraform.io/terraform-providers/openstack" to obtain schema:
      unknown provider "registry.terraform.io/terraform-providers/openstack"
      ```
      
      Terraform documentation describes how Terraform uses working directories [1]
      and there are at least to ways to resolve an issue. First one is using always
      one directory before running terraform subcommands. Second one is using option
      `-chdir` in all terraform commands [2].
      
      1. https://www.terraform.io/docs/cli/init/index.html
      2. https://www.terraform.io/docs/cli/commands/index.html#switching-working-directory-with-chdir
      
      Closes #6089
      4fea6bf8
    • Mergen Imeev's avatar
      box: make UUID part of SCALAR · 5ea50014
      Mergen Imeev authored
      Prior to this patch, UUID was not part of SCALAR. However, this should
      be changed to comply with the RFC "Consistent Lua/SQL types".
      
      Closes #6042
      
      @TarantoolBot document
      Title: UUID is now part of SCALAR
      
      The UUID field type is now part of the SCALAR field type. This means
      that now values of type UUID can be inserted into the SCALAR field, and
      these values can participate in the sorting of the SCALAR fields. The
      order is as follows: boolean < number < string < varbinary < uuid.
      5ea50014
    • Cyrill Gorcunov's avatar
      iproto: stringify IPROTO_RAFT, IPROTO_PROMOTE · 0d090b34
      Cyrill Gorcunov authored
      
      This allows `xlog` Lua module to decode appropriate
      types into symbolic form.
      
      For example with the patch we should see raft and
      promote types in output.
      
       | $ tarantoolctl cat 00000000000000000004.xlog
       | ---
       | HEADER:
       |   lsn: 2
       |   group_id: 1
       |   type: RAFT
       |   timestamp: 1621541912.4588
       | BODY:
       |   0: 3
       |   1: 4
       | ---
       | HEADER:
       |   lsn: 1
       |   replica_id: 4
       |   type: PROMOTE
       |   timestamp: 1621541912.4592
       | BODY:
       |   2: 0
       |   3: 0
       |   83: 3
      
      Fixes #6088
      
      Signed-off-by: default avatarCyrill Gorcunov <gorcunov@gmail.com>
      0d090b34
  10. May 23, 2021
  11. May 20, 2021
  12. May 19, 2021
    • Igor Munkin's avatar
      build: add missing module for jit.dump on ARM64 · 93e2ce52
      Igor Munkin authored
      
      Since commit c9d88d5f ('Fix #984: add
      jit.* library to the binary') all required modules implemented in Lua
      are bundled (i.e. compiled into the executable as a C literal) into
      Tarantool binary. While making Tarantool work on ARM64 platforms, it
      turned out the arch-specific module (namely, jit/dis_arm64.lua) is not
      bundled. Within this patch the missing sources are added and jit.dump
      works fine on ARM64 hosts as a result.
      
      Part of #5983
      Relates to #5629
      Follows up #984
      
      Reviewed-by: default avatarSergey Kaplun <skaplun@tarantool.org>
      Reviewed-by: default avatarSergey Ostanevich <sergos@tarantool.org>
      Signed-off-by: default avatarIgor Munkin <imun@tarantool.org>
      Unverified
      93e2ce52
    • Igor Munkin's avatar
      luajit: bump new version · 3fa165e5
      Igor Munkin authored
      * FFI/ARM64/OSX: Fix vararg call handling.
      * OSX/iOS: Handle iOS simulator and ARM64 Macs.
      * build: pass sysroot to MacOS SDK
      
      Closes #6065
      Closes #6066
      Part of #5629
      Relates to #5983
      Unverified
      3fa165e5
    • Alexander V. Tikhonov's avatar
      github-ci: add result message from coveralls in PR · 660e3263
      Alexander V. Tikhonov authored
      Workflow 'debug_coverage' produces and uploads results to 'coveralls.io'
      web site. Message about it can be shown in PR within each run was done.
      This patch adds the ability to send message in available PR otherwise it
      is skipped. Also added 'coverage.info' file to artifacts list.
      
      Found that used 'coverallsapp/github-action' action checks if the
      trigger was 'pull_request' used to run the workflow [1]. And only in
      this way it writes results message to PR. Previously 'pull_request'
      trigger was blocked to avoid duplication with 'push' trigger. To make
      able to run workflow by any single trigger and to send message to PR
      if it exits, it was implemented the following logic:
      
        - run workflows on both triggers 'push' and 'pull_request';
        - for workflow with 'push' trigger check if PR exists then skip all
          jobs otherwise continue running;
        - for workflow with 'pull_request' trigger continue running;
      
      To avoid of issue coverallsapp/github-action#55 [2], sources checkout
      should be based on 2nd version and later.
      
      Closes #5644
      
      [1]: https://github.com/coverallsapp/github-action/blob/master/src/run.ts#L38
      [2]: https://github.com/coverallsapp/github-action/issues/55#issuecomment-644927165
      660e3263
  13. May 18, 2021
    • Alexander Turenko's avatar
      test: update test-run (fix release_disabled) · 7bee6153
      Alexander Turenko authored
      The problem that is fixed by this test-run update is the following. A
      test that is listed in the 'release_disabled' field in a suite.ini file
      of a 'core = app' or a 'core = unittest' test suite was disabled at all,
      not only for the release tarantool build. A 'core = tarantool' test
      suite was not affected by the problem.
      
      Disabled sql-tap/debug_mode_only.test.lua test, because it does not work
      anymore. We plan to revisit this test in the scope of #3694.
      
      See https://github.com/tarantool/test-run/issues/199
      Unverified
      7bee6153
  14. May 17, 2021
  15. May 14, 2021
    • Vladislav Shpilevoy's avatar
      tuple: fix crash in reversed nullable json update · 75b2ccce
      Vladislav Shpilevoy authored
      Update of an absent field could crash when had 2 operations in
      reversed order both on not specified fields.
      
      The problem was that the rope item was created incorrectly.
      
      Rope item is a range of array fields and consists of 2 parts:
      xrow_update_field and a tail. The xrow field should describe
      exactly one array field (first in the given range) and its update
      operation. When no operation, it is NOP.
      
      The tail includes the rest of the array fields not affected by
      any operations yet.
      
      But in the code it was so the rope item was created with its xrow
      field covering multiple array fields, and with zero tail. As a
      result, split of that item didn't work because it can't split an
      xrow field.
      
      The bug was in the nil-autofill for absent array fields. The patch
      fixes it so the newly created item with nils has its xrow field
      containing one nil, and the other nils in the tail. This allows to
      split the item correctly if necessary.
      
      Closes #6069
      75b2ccce
    • Cyrill Gorcunov's avatar
      say: fix CFORMAT specification · bfdb3c5a
      Cyrill Gorcunov authored
      
      The position of first argument to check from is 6, not 0.
      Looks like our tests with CFORMAT was simply not working
      since commit 7d12d66e (Refactor macroses for compiler
      builtins and function attributes).
      
      Lets turn them all back.
      
      Follow-up #5846
      
      Reported-by: default avatarVladislav Shpilevoy <v.shpilevoy@tarantool.org>
      Signed-off-by: default avatarCyrill Gorcunov <gorcunov@gmail.com>
      bfdb3c5a
    • Cyrill Gorcunov's avatar
      wal: fix say_x format · fdaadd0a
      Cyrill Gorcunov authored
      
       - vclock_get returns int64_t
       - vclock_sum returns int64_t
      
      Follow-up #5846
      
      Signed-off-by: default avatarCyrill Gorcunov <gorcunov@gmail.com>
      fdaadd0a
    • Cyrill Gorcunov's avatar
      limbo: fix say_x format · 650830df
      Cyrill Gorcunov authored
      
      Use explicit cast for 64 bit number.
      
      Follow-up #5846
      
      Signed-off-by: default avatarCyrill Gorcunov <gorcunov@gmail.com>
      650830df
    • Cyrill Gorcunov's avatar
      txn: fix say_x format · 8ee77b26
      Cyrill Gorcunov authored
      
      Use explicit conversion for 64 bit number.
      
      Follow-up #5846
      
      Signed-off-by: default avatarCyrill Gorcunov <gorcunov@gmail.com>
      8ee77b26
Loading