Skip to content
Snippets Groups Projects
  1. Jun 16, 2022
    • Georgiy Lebedev's avatar
      box: fix transaction "read-view" and "conflicted" states · 4d52199e
      Georgiy Lebedev authored
      Currently, there is a fundamental logical inconsistency with read-view and
      conflicted states of transactions.
      
      Conflicted transactions see all prepared changes (e.g., #7238), because
      they are handled differently than read-view ones. At the same time, one
      does not know the state of the transaction until `box.commit` is called.
      
      A similar problem arises with read-view transactions: if such transactions
      do any DML statements, they are de-facto conflicted, but this will only be
      determined at preparation stage:
      https://github.com/tarantool/tarantool/blob/79245573dabf3c1eb4eb904fd80ee84270360476/src/box/txn.c#L1006-L1013
      
      Fix this inconsistency by the following changes:
      1. Conflict "read-view" transactions on attempt to perform DML statements
      immediately — guarantee this with an assertion at preparation stage.
      2. Make conflicted transactions unconditionally throw "Transaction has been
      aborted by conflict" error on any CRUD operations (including read-only
      ones) until they are either rolled back (which will return no error) or
      committed (which will return the same error).
      
      Closes #7238
      Closes #7239
      Closes #7240
      
      @TarantoolBot document
      Title: new  behaviour of "conflicted" transactions
      
      "Conflicted" transactions now return "Transaction aborted by conflicted"
      error on any CRUD operations (including read-only ones), until they are
      either rolled back (which will return no error) or committed (which will
      return the same error).
      4d52199e
    • Sergey Bronnikov's avatar
      tutorial: use https links · 2f80fbf0
      Sergey Bronnikov authored
      NO_CHANGELOG=internal
      NO_DOC=internal
      NO_TEST=internal
      2f80fbf0
    • Pavel Balaev's avatar
      tools: fix gdb.sh revision regex · 375ceaaa
      Pavel Balaev authored
      Regular expression now works on versions: alpha, beta, rc and so on.
      
      NO_DOC=bugfix
      NO_TEST=bugfix
      NO_CHANGELOG=bugfix
      375ceaaa
    • Pavel Balaev's avatar
      tools: edit gdb.sh code formatting · 83e8c50f
      Pavel Balaev authored
      Tabs were replaced with spaces to bypass checkpatch.
      
      NO_DOC=bugfix
      NO_TEST=bugfix
      NO_CHANGELOG=bugfix
      83e8c50f
  2. Jun 14, 2022
    • Vladimir Davydov's avatar
      test: fix flaky viny/tx_gap_lock test · b3f462bf
      Vladimir Davydov authored
      The `cmp_tuple` helper function is broken - it assumes that all tuple
      fields, including the payload, are numeric. It isn't true - the payload
      field is either nil or string. This results in a false-positive test
      failure:
      
      ```
      error: '[string "function cmp_tuple(t1, t2)     for i = 1, PAY..."]:1:
             attempt to compare nil with string'
      ```
      
      Closes #6336
      
      NO_DOC=test
      NO_CHANGELOG=test
      b3f462bf
    • Yaroslav Lobankov's avatar
      test-run: bump to new version · e6e73423
      Yaroslav Lobankov authored
      Bump test-run to new version with the following improvements:
      
        - Fix issue with not detecting successful server start [1]
      
      [1] tarantool/test-run#343
      
      NO_DOC=testing stuff
      NO_TEST=testing stuff
      NO_CHANGELOG=testing stuff
      e6e73423
  3. Jun 09, 2022
    • Vladimir Davydov's avatar
      test: set shutdown timeout to infinity for default luatest instance · ede831d3
      Vladimir Davydov authored
      With the default shutdown timeout of 3 seconds, a test that leaves
      behind asynchronous requests would still pass, but it would take longer
      to finish, because the server instance started by Tarantool would have
      to wait for the dangling requests to complete. Setting the timeout to
      infinity will result in a hang, making us fix the test.
      
      Infinite timeout is also good for catching bugs like #7225 and #7256.
      
      We don't set the timeout for diff and TAP tests because those are
      deprecated and shouldn't be used for writing new tests. Nevertheless,
      I manually checked that none of them hangs if the timeout is set to
      infinity.
      
      Closes #6820
      
      NO_DOC=test
      NO_CHANGELOG=test
      ede831d3
    • Vladimir Davydov's avatar
      iostream: shutdown socket fd before close · 9cf03555
      Vladimir Davydov authored
      If a socket fd is shared by a child process, closing it in the parent
      will not shut down the underlying connection. As a result, the server
      may hang executing the graceful shutdown protocol. Fix this problem by
      explicitly shutting down the connection socket fd before closing it.
      
      This is a recommended way to terminate a Unix socket connection, see
      http://www.faqs.org/faqs/unix-faq/socket/#:~:text=2.6.%20%20When%20should%20I%20use%20shutdown()%3F
      
      Closes #7256
      
      NO_DOC=bug fix
      9cf03555
    • Ilya Verbin's avatar
      wal: allow spurious wakeups in wal_write · 4bf52367
      Ilya Verbin authored
      It's possible to wakeup a fiber, which is waiting for WAL write
      completion, using Tarantool C API. This results in an error like:
      ```
      main/118/lua F> Journal result code -1 can't be converted to an error
      ```
      
      This patch introduces a flag, which is set when WAL write is
      finished, that allows fibers to yield until the flag is set.
      
      Closes #6506
      
      NO_DOC=bugfix
      4bf52367
    • Yaroslav Lobankov's avatar
      test-run: bump to new version · 0dc60b5f
      Yaroslav Lobankov authored
      Bump test-run to new version with the following improvements:
      
        - Fail *.test.py tests in case of server start errors [1]
      
      [1] tarantool/test-run#333
      
      NO_DOC=testing stuff
      NO_TEST=testing stuff
      NO_CHANGELOG=testing stuff
      0dc60b5f
  4. Jun 08, 2022
    • Mergen Imeev's avatar
      sql: fix wrong ephemeral space format · a6818acc
      Mergen Imeev authored
      This patch fixes format building when an ephemeral space was used in
      ORDER BY and ORDER BY uses at least two variables from the list of
      selected columns.
      
      Closes #7042
      
      NO_DOC=Bugfix
      a6818acc
    • Serge Petrenko's avatar
      decimal: fix index comparison with Inf, NaN · 22fc1f94
      Serge Petrenko authored
      There was an assertion failure when inserting  a decimal into an index
      which contained double Inf or NaN.
      
      The reason for that was never checking decimal_from_*() return values,
      and decimal_from_double() not being able to handle NaN or Inf, because
      these values are not representable in decimal numbers.
      
      Start handling decimal_from_<type> return values and fix decimal
      comparison with Inf, NaN.
      
      Closes #6377
      
      NO_DOC=bugfix
      22fc1f94
  5. Jun 07, 2022
    • Yaroslav Lobankov's avatar
      test: use unix socket in replication-py/swim tests · cb6fc4a3
      Yaroslav Lobankov authored
      To reduce the chance to encounter the tarantool/test-run#141 issue in
      replication-py/swim tests, let's switch to using unix sockets instead
      of TCP ports for tarantool console.
      
      NO_DOC=testing stuff
      NO_TEST=testing stuff
      NO_CHANGELOG=testing stuff
      cb6fc4a3
  6. Jun 06, 2022
    • Ilya Verbin's avatar
      core: allow spurious wakeups in cbus_call · bd6fb06a
      Ilya Verbin authored
      Currently it's possible to wakeup a fiber, which is waiting for `cbus_call`
      completion, using Tarantool C API. This will cause a misleading `TimedOut`
      error. This patch reworks `cbus_call` in such a way that it yields until
      a completion flag is set.
      
      Part of #7166
      
      NO_DOC=refactoring
      NO_CHANGELOG=refactoring
      bd6fb06a
    • Ilya Verbin's avatar
      core: get rid of unused cbus_flush · e568e7f0
      Ilya Verbin authored
      Part of #7166
      
      NO_DOC=refactoring
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      e568e7f0
    • Timur Safin's avatar
      datetime: refactor interval_to_string · b7ff1615
      Timur Safin authored
      Simplify/shorten `interval_to_string()` implementation.
      
      Part of #7045
      
      NO_CHANGELOG=refactoring
      NO_DOC=refactoring
      NO_TEST=refactoring
      b7ff1615
    • Timur Safin's avatar
      datetime: do not mess with nsec in interval · 36bc6f83
      Timur Safin authored
      Do not even try to make more readable output of secs/nsec,
      but rather report them as is, without any [de]normalization.
      
      Not the prior way:
      ```
      tarantool> dt.interval.new{min=1, sec=59, nsec=2e9+1}
      --
      - +1 minutes, 61.000000001 seconds
      ...
      ```
      
      But instead as:
      ```
      tarantool> dt.interval.new{min=1, sec=59, nsec=2e9+1}
      --
      - +1 minutes, 59 seconds, 2000000001 nanoseconds
      ...
      ```
      
      Closes #7045
      
      NO_DOC=internal
      36bc6f83
    • Vladimir Davydov's avatar
      net.box: fix hang in graceful shutdown protocol · 79245573
      Vladimir Davydov authored
      The graceful shutdown protocol works as follows:
      
       1. The server sends a shutdown request (the box.shutdown event) to all
          its clients that subscribed to it.
       2. Upon receiving a shutdown request, a client is supposed to close its
          connection.
       3. The server waits for all clients subscribed to box.shutdown event to
          exit.
       4. The server exits.
      
      In net.box, the box.shutdown event is processed by `remote._callback`.
      The problem is it may occur that `remote._callback` is garbage collected
      while the `remote` object isn't. If this happens, the shutdown request
      will never get processed, and the server won't exit until the `remote`
      object is garbage collected, which may take forever.
      
      Let's fix this issue by breaking the worker loop if we see that the
      callback was garbage collected.
      
      Closes #7225
      
      NO_DOC=bug fix
      79245573
  7. Jun 02, 2022
    • Boris Stepanenko's avatar
      build: define TZDIR for tzcode build · b9c9a7b0
      Boris Stepanenko authored
      nixos (and probably some other distributives) place zoneinfo directory
      not in /usr/share (in /etc for example). TZDIR is set accordingly.
      Currently zoneinfo is looked for in /usr/share, disregarding TZDIR env
      variable.
      
      This commit adds compile definition for TZDIR if such env variable is
      defined. This fixes zoneinfo lookup for nixos.
      
      NO_CHANGELOG=build
      NO_DOC=build
      NO_TEST=build
      b9c9a7b0
    • Vladimir Davydov's avatar
      Revert "github-ci: use openssl@1.1" · 6605de25
      Vladimir Davydov authored
      This reverts commit 33830978.
      
      Follow-up #6477
      
      NO_DOC=ci
      NO_TEST=ci
      NO_CHANGELOG=ci
      6605de25
    • Vladimir Davydov's avatar
      Revert "ci: fix RPM spec to build packages for Fedora 36" · 7e1df16e
      Vladimir Davydov authored
      This reverts commit 9d1f9f0e.
      
      Follow-up #6477
      
      NO_DOC=ci
      NO_TEST=ci
      NO_CHANGELOG=ci
      7e1df16e
    • Vladimir Davydov's avatar
      crypto: OpenSSL 3.0 support · e3bf73c8
      Vladimir Davydov authored
      Two things we need to do to fix build with OpenSSL 3.0:
      
      1. Use EVP_MAC_* functions instead of HMAC_*
         https://www.openssl.org/docs/man3.0/man3/HMAC_CTX_new.html
      
      2. Load the Legacy provider to enable legacy algorithms, such as MD4
         https://wiki.openssl.org/index.php/OpenSSL_3.0#Programming_in_OpenSSL_3.0
      
      Closes #6477
      
      NO_DOC=build fix
      NO_TEST=build fix
      NO_CHANGELOG=build fix
      e3bf73c8
    • Vladimir Davydov's avatar
      ssl: move OpenSSL library initialization code to separate file · f9739160
      Vladimir Davydov authored
      We redefine ssl_init and ssl_free in the EE build, because we need to do
      some extra work there. Currently, it's fine to duplicate the bulk of the
      OpenSSL library initialization code between EE and CE repositories, but
      with the introduction of OpenSSL 3.0 it's going to become more
      complicated so duplicating would look bad. Let's move the common code to
      ssl_init_impl() and ssl_free_impl() helper functions.
      
      Needed for #6477
      
      NO_DOC=refactoring
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      f9739160
    • Vladimir Davydov's avatar
      crypto: use ERR_reason_error_string instead of ERR_error_string · 9cc130f0
      Vladimir Davydov authored
      ERR_error_string adds some extra information that depends on the OpenSSL
      library version (code, module, method). This information says nothing to
      the end user, and it results in different test results after updating to
      OpenSSL 3.0. Let's use ERR_reason_error_string instead, which just
      prints a human-readable error message.
      
      Part of #6477
      
      NO_DOC=minor change in error message
      NO_CHANGELOG=minor change in error message
      9cc130f0
    • Vladimir Davydov's avatar
      crypto: fix openssl_err_str · f72662c5
      Vladimir Davydov authored
      openssl_err_str is used for reporting OpenSSL errors. It calls
      crypto_ERR_* functions using FFI. There's a typo in the code:
      ffi.crypto_ERR_error_string is used instead of ffi.C.*.
      
      We don't normally step on this, because OpenSSL doesn't return errors
      in our configuration, but if it did for some reason (e.g. a cipher was
      disabled in the library), we'd get a confusing error message.
      
      NO_DOC=bug fix
      NO_TEST=occur only on internal error
      NO_CHANGELOG=occur only on internal error
      f72662c5
  8. Jun 01, 2022
    • artembo's avatar
      ci: clean workspace on self-hosted runners · 7ff87404
      artembo authored
      Added 'tarantool/actions/cleanup' action to each job which uses
      self-hosted runners.
      
      The action cleans workspace directory of self-hosted runner after
      previous run. The main reason to add this action is 'Need a single
      revision' error [1] caused by a conflict of submodule versions,
      the standard 'actions/checkout' action fails with this error. It's a
      well-known problem and related issue [2] is still opened.
      
      [1] https://github.com/tarantool/tarantool-qa/issues/145
      [2] https://github.com/actions/checkout/issues/418
      
      NO_DOC=ci
      NO_TEST=ci
      NO_CHANGELOG=ci
      
      Closes tarantool/tarantool-qa#145
      7ff87404
    • Andrey Saranchin's avatar
      core: introduce clock_lowres · 37d5ac5a
      Andrey Saranchin authored
      This patch introduces not thread-safe low resolution
      monotonic clock, based on interval timer. It should
      be used only by thread that initialized it.
      
      Part of #6085
      
      NO_CHANGELOG=internal feature
      NO_DOC=internal feature
      37d5ac5a
    • Andrey Saranchin's avatar
      replace sigprocmask() with pthread_sigmask() · 50107cf2
      Andrey Saranchin authored
      Since the use of sigprocmask() is unspecified in a multithreaded
      process we should use pthread_sigmask() instead. This patch
      replaces all the sigprocmask calls with pthread analogue.
      
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      NO_DOC=refactoring
      50107cf2
    • Yaroslav Lobankov's avatar
      ci: don't overwrite job artifacts in pkg workflows · 37759699
      Yaroslav Lobankov authored
      To ensure that regular and GC64 jobs in packaging workflows don't
      overwrite artifacts of each other, we need to use a different artifact
      name per job.
      
      NO_DOC=ci
      NO_TEST=ci
      NO_CHANGELOG=ci
      37759699
    • Yaroslav Lobankov's avatar
      ci: fix artifacts gathering for package workflows · db6bbb59
      Yaroslav Lobankov authored
      In PR #7090 we forgot to update the path to gather failure artifacts for
      many packaging workflows. Now it is fixed.
      
      NO_DOC=ci
      NO_TEST=ci
      NO_CHANGELOG=ci
      db6bbb59
    • Alexander Turenko's avatar
      doc: add contributing guide · 55bdb42d
      Alexander Turenko authored
      GitHub suggests to look on the document, when it is present. The banner
      is shown for visitors of issues and pull requests pages. We can use this
      feature to highlight typical stones on the contributor's road.
      
      My goal is to leave suggestions for typical points of a confusion in a
      short document (don't bury into details) and leave links for further
      reading.
      
      I hope we should move most of content of the 'open a pull request'
      section to a wiki page and possibly merge it with [1] and [2]. It
      requires more work and I would consider it as a future step toward good
      developer guidelines.
      
      [1]: https://github.com/tarantool/tarantool/wiki/Code-review-procedure
      [2]: https://www.tarantool.io/en/doc/latest/dev_guide/developer_guidelines
      
      NO_CHANGELOG=not a user visible change
      NO_DOC=nothing requires an update on the website
      NO_TEST=it is purely documentation change
      55bdb42d
  9. May 31, 2022
    • Serge Petrenko's avatar
      box: introduce helpers to check extension type validity · 5b47124a
      Serge Petrenko authored
      Introduce helpers for each of our custom extension types.
      The helpers will be used by mp_check() to validate extension contents
      and make sure no malformed data is accepted by tarantool.
      
      Closes #6857
      
      NO_DOC=no user visible changes
      5b47124a
    • Serge Petrenko's avatar
      net.box: introduce _inject remote method · 5893d61d
      Serge Petrenko authored
      The inject remote method is used in testing quite a lot. For example,
      when someone needs to pass arbitrary MsgPack to Tarantool.
      
      The current way to use it is:
      conn:_request(netbox._method.inject, opts, nil, nil, custom_msgpack)
      
      This is quite long and ugly, so let's add a helper:
      conn:_inject(custom_msgpack, opts)
      
      Also, while we're at it, lets fix the following issue.
      The _inject remote method is barely usable without knowing which sync
      net.box will use for the next request.
      
      On the one hand, the user has to encode some custom sync to the request
      he's injecting.
      On the other hand, net.box doesn't parse the custom sync and always uses
      its own pre-generated one to wait for the request response.
      
      So the user has to pick the correct sync value, which net.box uses
      internally.
      
      Let's make life simpler and introduce _next_sync method, which returns
      the next sync, which will be used by net.box.
      
      In-scope-of #6857
      Closes #7177
      
      NO_DOC=internal change
      NO_CHANGELOG=internal change
      NO_TEST=tested implicitly in next commit
      5893d61d
    • Vladimir Davydov's avatar
      applier: add timeout to greeting read · c6485d8d
      Vladimir Davydov authored
      A Tarantool server is supposed to send a greeting message right after
      accepting a new client so the first thing an applier does after
      connecting to the master is reads the greeting. It does this without
      timeouts. The problem is that if by mistake we connect to a wrong
      instance, which doesn't send anything to clients, the applier will hang
      forever (until the remote closes the socket), without logging any
      errors.
      
      This may happen even with a valid Tarantool instance - if SSL encryption
      is enabled on the master, but not on the client, because the SSL
      protocol assumes that the client initiates a connection by writing to
      the socket first (before the server).
      
      Let's add a timeout to the operation reading the greeting. The timeout
      is set to replication_disconnect_timeout(), after which a connection is
      broken if the master doesn't send heartbeats for that long. Note, we
      don't add a timeout to other read/write operations issued to initiate a
      replication connection, because if we received a greeting and it's
      valid, then the master is likely to be fine.
      
      Closes #7204
      
      NO_DOC=bug
      c6485d8d
    • Georgiy Lebedev's avatar
      test: fix #6310 upgrade test · 59ce25dd
      Georgiy Lebedev authored
      The upgrade test worked incorrectly: the instances WAL directory contained
      xlog with the latest schema version and the snapshot contained an older
      schema version (2.7.1) than required (2.9.1), whereas there only need to
      be a snapshot with 2.9.1 schema version — fix this descrepancy.
      
      Also, schema upgrade is performed automatically: remove the redundant
      `box.schema.upgrade` call.
      
      NO_CHANGELOG=test fix
      NO_DOC=test fix
      NO_DOC=test fix
      59ce25dd
  10. May 30, 2022
    • Oleg Babin's avatar
      fiber: don't skip fiber_obj:info() arguments · 0eac13b9
      Oleg Babin authored
      Commit b18dd47f ("Introduce backtrace=true option to fiber.info()")
      introduced a way to skip backtraces in fiber.info() calls.
      Commit 9da7e03e ("fiber: introduce fiber_o:info() and fiber_o:csw()")
      introduced `options` function for fiber object however it ignored
      passed options.
      This patch fixed it. Currently fiber:info({backtrace = false})
      returns info without backtrace.
      
      Closes #7210
      
      NO_DOC=bugfix
      0eac13b9
  11. May 26, 2022
  12. May 25, 2022
    • Timur Safin's avatar
      build: submodule third_party/tz instead of git · 4eaff4e0
      Timur Safin authored
      FreeBSD Tarantool port has some problems if build uses cmake'
      ExternalProject_Add which refers to the github repository.
      Sumodule works better - so switching to using it.
      
      NO_CHANGELOG=build
      NO_DOC=build
      NO_TEST=build
      4eaff4e0
    • Timur Safin's avatar
      build: datetime insource build · 5f143288
      Timur Safin authored
      Previous version of tzcode/CMakeLists.txt leaves untracked files under
      source directory src/lib/tzcode/tz/. We have changed slightly an approach
      used to checkout and build IANA github sources under build/ directory,
      not in ${PROJECT_BINARY_DIR} (which may be pointing not to out-of-source
      build directory, but rather to the repository root itself, if insource
      build used).
      
      Closes #7173
      
      NO_CHANGELOG=infra
      NO_DOC=infra
      NO_TEST=infra
      5f143288
Loading