Skip to content
Snippets Groups Projects
  1. Jan 16, 2024
    • Maksim Kaitmazian's avatar
      feat: implement md5 authentication · 91aea88a
      Maksim Kaitmazian authored and Дмитрий Кольцов's avatar Дмитрий Кольцов committed
      It prevents password sniffing and avoids storing passwords on the
      server in plain text but provides no protection if an attacker
      manages to steal the password hash from the server.
      
      Usage example:
      ```lua
      -- Enable the md5 authentication method for all new users.
      box.cfg({auth_type = 'md5'})
      
      -- Reset existing user passwords to use the md5 authentication method.
      box.schema.user.passwd('alice', 'topsecret')
      
      -- Authenticate using the md5 authentication method via net.box.
      conn = require('net.box').connect(uri, {
          user = 'alice',
          password = 'topsecret',
          -- Specifying the authentication method isn't strictly necessary:
          -- by default the client will use the method set in the remote
      	-- server config (box.cfg.auth_type)
          auth_type = 'md5',
      })
      ```
      
      part of picodata/picodata/sbroad!377
      
      @TarantoolBot document
      Title: md5 authentication method
      
      See the commit message.
      91aea88a
    • Maksim Kaitmazian's avatar
      feat: add user name argument to `auth_method` api · eec2e89a
      Maksim Kaitmazian authored and Дмитрий Кольцов's avatar Дмитрий Кольцов committed
      User name is usually used as a salt for user password in order to
      avoid password repeating.
      For instance, postgres md5 authentication stores passwords as
      md5("password", "user"), so that the same passwords are represented by
      different hashes.
      
      part of picodata/picodata/sbroad!377
      
      @TarantoolBot document
      Title: Document updated `box.schema.user.password` declaration.
      
      Since auth methods can use user name for hashing, user name is
      added to argument list of `box.schema.user.password`.
      
      NO_TEST=there are no methods that use user name
      eec2e89a
    • godzie44's avatar
      fix: use-after-free in `cbus_endpoint_delete` · 4c6c25c5
      godzie44 authored and Дмитрий Кольцов's avatar Дмитрий Кольцов committed
      Calling a `TRASH` macro after calling the `free`
      function dereferences the pointer to the already
      freed memory.
      
      NO_DOC=picodata internal patch
      NO_CHANGELOG=picodata internal patch
      NO_TEST=picodata internal patch
      4c6c25c5
    • Gleb Kashkin's avatar
      console: fix :endswith() err in tntctl connection · 825b2df1
      Gleb Kashkin authored and Дмитрий Кольцов's avatar Дмитрий Кольцов committed
      There used to be a rare error when failed to connect via tarantoolctl to
      listening cartridge console. It was caused by unclear
      console.local_print() contract. Starting from gh-7031 fix, the function
      assumed string-only arguments, while in some cases cdata error was
      passed.
      
      Now console.local_print() prints all non-string arguments as is, without
      modifying potential local_eos.
      
      Closes #8374
      
      NO_DOC=bugfix
      NO_TEST=very hard to test
      825b2df1
    • Denis Smirnov's avatar
      fix: tuple hash calculation tests · 4ba68a13
      Denis Smirnov authored and Дмитрий Кольцов's avatar Дмитрий Кольцов committed
      Tuple hash calculation tests for the C API were incorrect. Thanks
      to the full pipeline with DEBUG build we detected the problem and
      fixed it.
      
      NO_DOC=picodata internal patch
      NO_CHANGELOG=picodata internal patch
      4ba68a13
    • Denis Smirnov's avatar
      feat: expose tuple hash calculation method · bb5d5b7e
      Denis Smirnov authored and Дмитрий Кольцов's avatar Дмитрий Кольцов committed
      Picodata supports cluster-wide SQL and needs some predictable
      method to calculate tuple hashes for the bucket ids. Method
      should be available for Lua, C and Rust users. It was decided
      to expose a murmur3 hash calculation method of the key_def module.
      
      NO_DOC=picodata internal patch
      NO_CHANGELOG=picodata internal patch
      bb5d5b7e
    • godzie44's avatar
      cbus: introduce lcpipe - light cpipe · 28fe188b
      godzie44 authored and Дмитрий Кольцов's avatar Дмитрий Кольцов committed
      Introduced a new type of cbus pipe - lcpipe. The current pipe in the
      cbus - cpipe, has a number of limitations, first of all - the cpipe
      cannot be used from the 3rd party threads, cpipe only works as a channel
      between two cords. That why lcpipe is needed. Its main responsibility -
      create channel between any thread and tarantool cord.
      
      Internally lcpipe is a cpipe, but:
      - on flush triggers removed, cause triggers use thread-local mem-pool,
      this is not possible on a third party thread
      - producer event loop removed, cause there is no libev event loop in
      third party thread
      
      Also, lcpipe interface is exported to the outside world.
      
      NO_DOC=core feature
      28fe188b
    • Дмитрий Кольцов's avatar
      build(CMakeLists.txt): disable feedback daemon by default · 2c4b4e80
      Дмитрий Кольцов authored
      NO_DOC=disable feedback
      NO_TEST=disable feedback
      2c4b4e80
    • Дмитрий Кольцов's avatar
      fix(schema version): fix some types that were not updated to 64 bit · f0680680
      Дмитрий Кольцов authored
      NO_DOC=core feature
      NO_TEST=no Lua API
      NO_CHANGELOG=bugfix
      f0680680
    • Дмитрий Кольцов's avatar
      feat(json): add option to encode decimals as string · 440fc11e
      Дмитрий Кольцов authored
      Due to inconsistency of Tarantool type casting while using strict
      data types as "double" or "unsigned" it is needed
      to use "number" data type in a whole bunch of cases.
      However "number" may contain "decimal" that will be serialized into
      string by JSON builtin module.
      
      This commit adds "encode_decimal_as_number" parameter to json.cfg{}.
      That forces to encode `decimal` as JSON number to force type
      consistency in JSON output.
      Use with catious - most of JSON parsers assume that number is restricted
      to float64.
      
      NO_DOC=we do not host doc
      440fc11e
    • Denis Smirnov's avatar
      sql: fix string dequoting · 60f4cfd2
      Denis Smirnov authored and Дмитрий Кольцов's avatar Дмитрий Кольцов committed
      
      Previously,
      
      select "t1"."a" from (select "a" from "t") as "t1";
      
      returned a result column name `t1` instead of `t1.a` because of
      incorrect work of a dequoting function. The reason was that
      previously sqlDequote() function finished its work when found the
      first closing quote.
      
      Old logic worked for simple selects where the column name doesn't
      contain an explicit scan name ("a" -> a).
      But for the sub-queries results sqlDequote() finished its work right
      after the scan name ("t1"."a" -> t1). Now the function continues its
      deqouting till it gets the null terminator at the end of the string.
      
      Closes #7063
      
      NO_DOC=don't change any public API, only a bug fix
      
      Co-authored-by: default avatarMergen Imeev <imeevma@gmail.com>
      60f4cfd2
    • Denis Smirnov's avatar
      sql: recompile expired prepared statements · a38965d6
      Denis Smirnov authored and Дмитрий Кольцов's avatar Дмитрий Кольцов committed
      Actually there is no reason to throw an error and make a user
      manually recreate prepared statement when it expires. A much more
      user friendly way is to recreate it under hood when statement's
      schema version differs from the box one.
      
      NO_DOC=refactoring
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      a38965d6
    • Denis Smirnov's avatar
      fix: default result parameter type · eeeb497b
      Denis Smirnov authored and Дмитрий Кольцов's avatar Дмитрий Кольцов committed
      Problem description.
      
      When we prepare a statement with parameters in the result columns
      (for example box.prepare('select ?')) Tarantool has no information
      about the type of the output column and set it to default boolean.
      Then, on the execution phase, the type would be recalculated during
      the parameter binding.
      
      Tarantool expects that there is no way for parameter to appear in the
      result tuple other than exactly be mentioned in the final projection.
      But it is incorrect - we can easily propagate parameter from the inner
      part of the join. For example
      
      box.prepare([[select COLUMN_1 from t1 join (values (?)) as t2 on true]])
      
      In this case column COLUMN_1 in the final projection is not a
      parameter, but a "reference" to it and its type depends on the
      parameter from the inner part of the join. But as Tarantool
      recalculates only binded parameters in the result projection,
      it doesn't change the default boolean metadata type of the COLUMN_1
      and the query fails on comparison with the actual type of the tuple.
      
      Solution.
      As we don't want to patch Vdbe to make COLUMN_1 refer inner parameter,
      it was decided to make a simple workaround: change the default
      column type from BOOLEAN to ANY for parameters. It fixes the
      comparison with the actual tuple type (we do not fail), but in some
      cases get ANY column in the results where we would like to have
      explicitly defined type. Also NULL parameters would also have ANY
      type, though Tarantool prefers to have BOOLEAN in this case.
      
      Closes https://github.com/tarantool/tarantool/issues/7283
      
      NO_DOC=bug fix
      eeeb497b
    • godzie44's avatar
      sql: add sql_execute_prepared_ext function, same as sql_execute_prepared but... · 90ff6574
      godzie44 authored and Дмитрий Кольцов's avatar Дмитрий Кольцов committed
      sql: add sql_execute_prepared_ext function, same as sql_execute_prepared but without `region` parameter
      closes #2
      
      NO_DOC=minor
      NO_TEST=minor
      90ff6574
    • godzie44's avatar
      compatibility with tarantool-module: · d8c626d5
      godzie44 authored and Дмитрий Кольцов's avatar Дмитрий Кольцов committed
      - add box_tuple_data_offset function (return offset of the messagePack encoded data from the beginning of the tuple)
      - add more export functions
      
      closes #1
      
      NO_DOC=build
      NO_TEST=build
      d8c626d5
    • Alexey Protsenko's avatar
      build(gitlab): setup all CI · 0b7f875d
      Alexey Protsenko authored and Дмитрий Кольцов's avatar Дмитрий Кольцов committed
      Add to .gitlab.ci.yml test_linux, test_debian_docker_luacheck, coverage
      from .travis.mk. Also sign package on build
      Add checkpatch linter.
      Add docker image build. Image copies original tarantool/tarantool from
      Dockerhub
      
      NO_DOC=ci change
      NO_TEST=ci change
      NO_CHANGELOG=ci change
      0b7f875d
  2. Dec 07, 2023
  3. Dec 05, 2023
    • Sergey Kaplun's avatar
      lua: prevent serialization of error for ucdata · 074fe0bf
      Sergey Kaplun authored
      Without checking the return value of lua_pcall()` in
      `lua_field_inspect_ucdata()`, the error message itself is returned as a
      serialized result. The result status of `lua_pcall()` is not ignored
      now.
      
      NO_DOC=bugfix
      
      Closes #9396
      
      (cherry picked from commit 98474f70)
      074fe0bf
    • Maxim Kokryashkin's avatar
      build: purge sysprof.collapse module · 2e9d205b
      Maxim Kokryashkin authored
      This module became unused as a result of LuaJIT bump made in the
      commit 88333d13 ("luajit: bump new version"), so it can be
      purged safely from the Tarantool sources.
      
      Part of #8700
      
      NO_DOC=internal
      NO_TEST=internal
      NO_CHANGELOG=added within the aforementioned commit
      
      (cherry picked from commit e2851883)
      2e9d205b
  4. Dec 02, 2023
    • Serge Petrenko's avatar
      replication: fix extraneous split-brain alerting · 718aeb14
      Serge Petrenko authored
      Current split-brain detector implementation raises an error each time a
      CONFIRM or ROLLBACK entry is received from the previous synchronous
      transaction queue owner. It is assumed that the new queue owner must
      have witnessed all the previous CONFIRMS. Besides, according to Raft,
      ROLLBACK should never happen.
      
      Actually there is a case when a CONFIRM from an old term is legal: it's
      possible that during leader transition old leader writes a CONFIRM for
      the same transaction that is confirmed by the new leader's PROMOTE. If
      PROMOTE and CONFIRM lsns match there is nothing bad about such
      situation.
      
      Symmetrically, when an old leader issues a ROLLBACK with the lsn right
      after the new leader's PROMOTE lsn, it is not a split-brain.
      
      Allow such cases by tracking the last confirmed lsn for each synchronous
      transaction queue owner and silently nopifying CONFIRMs with an lsn less
      than the one recorded and ROLLBACKs with lsn greater than that.
      
      Closes #9138
      
      NO_DOC=bugfix
      
      (cherry picked from commit ffa6ac15)
      718aeb14
    • Serge Petrenko's avatar
      replication: persist confirmed vclock on replicas · bcbe9232
      Serge Petrenko authored
      Previously the replicas only persisted the confirmed lsn of the current
      synchronous transaction queue owner. As soon as the onwer changed, the
      info about which lsn was confirmed by the previous owner was lost.
      
      Actually, this info is needed to correctly filter synchro requests
      coming from the old term, so start tracking confirmed vclock instead of
      the confirmed lsn on replicas.
      
      In-scope of #9138
      
      NO_TEST=covered by the next commit
      NO_CHANGELOG=internal change
      
      @TarantoolBot document
      Title: Document new IPROTO_RAFT_PROMOTE request field
      
      IPROTO_RAFT_PROMOTE and IPROTO_RAFT_DEMOTE requests receive a new key
      value pair:
      
      IPROTO_VCLOCK : MP_MAP
      
      The vclock holds a confirmed vclock of the node sending the request.
      
      (cherry picked from commit c4415d44)
      bcbe9232
    • Serge Petrenko's avatar
      xrow: remove SYNCHRO_BODY_LEN_MAX constant · 8d457af4
      Serge Petrenko authored
      Synchronous requests will receive a new field encoding a full vclock
      soon. Theoretically a vclock may take up to ~ 300-400 bytes (3 bytes for
      a map header + 32 components each taking up 1 byte for replica id and up
      to 9 bytes for lsn). So it makes no sense to increase
      SYNCHRO_BODY_LEN_MAX from 32 to 400-500. It would become almost the same
      as plain BODY_LEN_MAX. Simply reuse the latter everywhere.
      
      In-scope-of #9138
      
      NO_DOC=refactoring
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      
      (cherry picked from commit 53605779)
      8d457af4
    • Serge Petrenko's avatar
      xrow: fix xrow_decode_synchro rejecting non-int types · 77853bef
      Serge Petrenko authored
      There was an error in xrow_decode_synchro: it compared the expected type
      of the value to the type of the key (MP_UINT) instead of the type of the
      actual value. This went unnoticed because all values in synchro requests
      were integers.
      
      This is going to change soon, when PROMOTE requests will start holding a
      vclock, so fix the wrong type check.
      
      In-scope-of #9138
      
      NO_DOC=bugfix
      NO_CHANGELOG=not user-visible
      
      (cherry picked from commit c18410f5)
      77853bef
  5. Nov 28, 2023
    • Vladimir Davydov's avatar
      net.box: allow calling stored Lua and C module functions with self.call · d462c77c
      Vladimir Davydov authored
      The fix is simple: look up the function in `box.func` by name and, if
      found, execute its `call` method. The only tricky part is to avoid the
      lookup before `box.cfg` is called because `box.func` is unavailable at
      the time. We achieve that by checking `box.ctl.is_recovery_finished`.
      
      Closes #9131
      
      NO_DOC=bug fix
      
      (cherry picked from commit e92a8e7b)
      d462c77c
    • Sergey Vorontsov's avatar
      ci: remove using Docker container in source.yml · 996025c5
      Sergey Vorontsov authored
      In this commit, we're fixing a problem with Docker in the workflow
      `.github/workflows/source.yml`.
      
      The mentioned workflow uses the `.github/actions/environment` action
      that needs a permission to make a loopback device for [1]. We didn't
      allow for that before due to missing container args, and it caused the
      following error:
      
      ```
      umount: /tmp/luajit-test-vardir: must be superuser to unmount.
      256000+0 records in
      256000+0 records out
      1048576000 bytes (1.0 GB, 1000 MiB) copied, 1.36702 s, 767 MB/s
      mount: /tmp/luajit-test-vardir: mount failed: Operation not permitted.
      Error: Process completed with exit code 1.
      ```
      
      The problem started since commit af996bbb ("ci: dockerize
      linux workflows"). The simplest way to fix the issue is not to run
      the workflow inside a Docker container because a tarball with the
      source code is created via the `./packpack/packpack tarball` command
      that runs a Docker container as well.
      
      [1] https://github.com/tarantool/tarantool/issues/7472
      
      NO_DOC=ci
      NO_TEST=ci
      NO_CHANGELOG=ci
      
      (cherry picked from commit 09ad57f4)
      996025c5
    • Nikolay Shirokovskiy's avatar
      fiber: fix use-after-free on shutdown with lingering fiber join · 18e0f810
      Nikolay Shirokovskiy authored
      On Tarantool shutdown we destroy all the fibers in some sequence. We
      don't require that all the fibers are finished before shutdown. So it
      may turn out that we first destroy some alive fiber and then destroy
      another alive fiber which joins the first one. Currently we have
      use-after-free issue in this case because clearing `link` field of
      the second fiber changes `wake` field of the first fiber.
      
      Close #9406
      
      NO_DOC=bugfix
      
      (cherry picked from commit 2f7ec948)
      18e0f810
    • Nikolay Shirokovskiy's avatar
      main: don't break graceful shutdown on init script exit · cd303945
      Nikolay Shirokovskiy authored
      Graceful shutdown is done in a special fiber which is started for
      example on SIGTERM. So it can run concurrently with fiber executing
      Tarantool init script. On init fiber exit we break event loop to pass
      control back to the Tarantool initialization code. But we fail to run
      event loop a bit more to finish graceful shutdown.
      
      The test is a bit contrived. A more real world case is when Tarantool is
      termintated during lingering box.cfg().
      
      Close #9411
      
      NO_DOC=bugfix
      
      (cherry picked from commit 786eb2ac)
      cd303945
    • Sergey Vorontsov's avatar
      ci: dockerize linux workflows · a9db25ae
      Sergey Vorontsov authored
      Modify Linux workflows for running jobs inside Docker containers. It
      helps isolate the building and testing environment from the runner's
      system and other workflows.
      
      Closes tarantool/tarantool-qa#327
      
      NO_DOC=ci
      NO_TEST=ci
      NO_CHANGELOG=ci
      
      (cherry picked from commit af996bbb)
      a9db25ae
  6. Nov 27, 2023
    • Mergen Imeev's avatar
      sql: remove one row limit in EXISTS subquery · b5b37629
      Mergen Imeev authored
      According to ANSI, EXISTS is a predicate that tests a given subquery and
      returns true if it returns more than 0 rows, false otherwise. However,
      after 2a720d11, EXISTS worked correctly only if there were exactly 0
      or 1 rows, and in all other cases it gave an error. This patch makes
      EXITS work properly.
      
      Closes #8676
      
      NO_DOC=bugfix
      
      (cherry picked from commit a5e498d1)
      b5b37629
  7. Nov 23, 2023
    • Sergey Vorontsov's avatar
      ci: use GitHub-hosted runner to upload sources · e296e312
      Sergey Vorontsov authored
      In the `.github/workflows/source.yml` workflow for preparing a tarball
      with the source code, a PackPack Docker container is already used. For
      uploading the tarball to the repo, the `aws` utility is used, which is
      installed before. To skip installation of additional packages on the
      self-hosted runners, we are moving to the GitHub-hosted runners, which
      already have the `aws` utility installed. Step `Prepare checkout` is
      removed because the GitHub-hosted runner is an ephemeral environment.
      
      NO_DOC=ci
      NO_TEST=ci
      NO_CHANGELOG=ci
      
      (cherry picked from commit 3ee68d8b)
      e296e312
  8. Nov 22, 2023
  9. Nov 21, 2023
    • Igor Munkin's avatar
      luajit: bump new version · d953b064
      Igor Munkin authored
      * Mark CONV as non-weak, to prevent elimination of its side-effect.
      * Fix ABC FOLD rule with constants.
      * test: add test for conversions folding
      * Add NaN check to IR_NEWREF.
      * LJ_GC64: Fix lua_concat().
      * test: introduce asserts assert_str{_not}_equal
      * ci: enable codespell
      * cmake: introduce target with codespell
      * codehealth: fix typos
      * tools: add cli flag to run profile dump parsers
      * profilers: purge generation mechanism
      * memprof: refactor symbol resolution
      * sysprof: fix crash during FFUNC stream
      * Fix last commit.
      * Print errors from __gc finalizers instead of rethrowing them.
      * x86/x64: Fix math.ceil(-0.9) result sign.
      * test: fix flaky fix-jit-dump-ir-conv.test.lua
      * IR_MIN/IR_MAX is non-commutative due to underlying FPU ops.
      * Fix jit.dump() output for IR_CONV.
      * Fix FOLD rule for x-0.
      * FFI: Fix pragma push stack limit check and throw on overflow.
      * Prevent compile of __concat with tailcall to fast function.
      * Fix base register coalescing in side trace.
      * Fix register mask for stack check in head of side trace.
      * x64: Properly fix __call metamethod return dispatch.
      
      Closes #8594
      Closes #8767
      Closes #9339
      Part of #9145
      
      NO_DOC=LuaJIT submodule bump
      NO_TEST=LuaJIT submodule bump
      d953b064
  10. Nov 10, 2023
    • Vladimir Davydov's avatar
      cmake: check static build dependencies in post build command · adbcedc0
      Vladimir Davydov authored
      Instead of using ctest, let's simply run the CheckDependencies.cmake as
      a post build command if Tarantool was built without dependencies. The
      good thing about it is that the check will run even if the static build
      is created directly, without the /static-build/CMakeLists.txt wrapper.
      
      Part of #9242
      
      NO_DOC=build
      NO_TEST=build
      NO_CHANGELOG=build
      
      (cherry picked from commit fa4939bd)
      adbcedc0
Loading