Skip to content
Snippets Groups Projects
  1. Oct 27, 2023
    • Nikolay Shirokovskiy's avatar
      small: bump version · f399cc7b
      Nikolay Shirokovskiy authored
      New commits:
      
      - test: fix test build for Debian 9 and alike
      - test: fix unused variable warning in matras test
      
      NO_TEST=submodule bump
      NO_CHANGELOG=submodule bump
      NO_DOC=submodule bump
      f399cc7b
    • Nikita Zheleztsov's avatar
      config: set names automatically on schema upgrade · 24d7c8f3
      Nikita Zheleztsov authored
      It's impossible to set names on Tarantool below 3.0.0, as all DDL
      is forbidden before schema upgrade.
      
      Let's make names NoOp on schema below Tarantool 3.0.0 and set names
      automatically only when schema upgrade is done.
      
      Follow-up #8978
      
      NO_DOC=tarantool/doc#3661
      24d7c8f3
    • Nikita Zheleztsov's avatar
      lua: move mkversion into a separate module · 29daaf3e
      Nikita Zheleztsov authored
      This commit moves all code, related to working with versions and which
      was used in box/lua/upgrade.lua, into a separate module and exports it
      to Lua API as 'internal.version'
      
      This is needed, as in the following commit we set names automatically
      only when schema version is more than 3.0.0. This module is used their
      in order to avoid code duplication.
      
      Follow-up #8978
      
      NO_DOC=internal
      NO_TEST=<already tested>
      NO_CHANGELOG=internal
      29daaf3e
    • Nikita Zheleztsov's avatar
      config: automatically set missing names · d3ce4b78
      Nikita Zheleztsov authored
      For now it's impossible to use config module in order to recover
      from snaps, which don't have names set in them. Calling box.cfg
      with names on recovery fails with MISMATCH error, which is caused
      by difficult implementation of setting names on first box.cfg,
      as names can be set only on rw instance.
      
      This commit doesn't call box.cfg with names, if these names are
      missing from the snapshot file. Instead it creates a fiber, which
      will set names, when it's possible to do so. Only master sets the
      names for the whole cluster.
      
      Closes #8978
      
      NO_DOC=tarantool/doc#3661
      NO_CHANGELOG=following commits
      d3ce4b78
    • Nikita Zheleztsov's avatar
      box: fix replica hang after applying already set name · 9988ac58
      Nikita Zheleztsov authored
      When the name is manually set on master by replace in _cluster space,
      calling box.cfg on replica with the same name causes its hang. The
      problem is the fact, that resubscribe is initiated and waiting for
      APPLIER_REGISTERED status is started. As applier knows, that no
      registration should be done, this never happens.
      
      Let's don't initiate registration, when instance name is already set.
      
      Needed for #8978
      
      NO_DOC=bugfix
      NO_CHANGELOG=not released yet
      9988ac58
    • Nikita Zheleztsov's avatar
      config: introduce droppable alerts · fa97cc0c
      Nikita Zheleztsov authored
      For now it's impossible to drop created alert in any way except
      manual searching for _alerts table. However, we need to drop alerts
      on missing names, when the names are set.
      
      Let's introduce simple key-value alerts in order to easily drop them
      by key.
      
      Needed for #8978
      
      NO_DOC=internal
      NO_TEST=following commit
      NO_CHANGELOG=internal
      fa97cc0c
    • Nikita Zheleztsov's avatar
      config: validate names and UUIDs before box.cfg · b04f9c5f
      Nikita Zheleztsov authored
      Currently only instance_uuid is validated before recovery process.
      All names and replicaset_uuid are checked only when recovery is done,
      which can take a long time. It can be frustrating to users, which
      have been waiting for several hours only to get name mismatch error.
      
      Let's read the small part of snapshot file before calling box.cfg
      in order to figure out, whether the names and uuids, passed to
      configuration match the ones, saved inside the snapshot.
      
      During config reload there's no sense in reading snapshot file, as
      data is already saved inside spaces, let's read them. We still check
      that names in config and names in spaces don't contradict during
      config reload.
      
      This commit also introduces methods, for getting names, which are
      not set in snap (or memory), this'll be used in consequent commits
      to set names automatically.
      
      Needed for #8978
      
      NO_DOC=tarantool/doc#3661
      b04f9c5f
    • Nikita Zheleztsov's avatar
      box: expose box.schema before box.cfg · e7ca37bf
      Nikita Zheleztsov authored
      box.schema has a number of constants, e.g. IDs of system spaces,
      which may be useful for the user. Let's allow to access box.schema
      before box.cfg is called.
      
      It is used in checking names, as we need to know, which snapshot spaces
      to scan.
      
      Needed for #8978
      
      NO_DOC=minor change
      e7ca37bf
    • Nikita Zheleztsov's avatar
      lua: introduce xlog.meta() method · 145af72b
      Nikita Zheleztsov authored
      This commit introduces the new method for xlog module: xlog.meta().
      It opens an xlog file, reads and returns the meta block of the file,
      which includes its filetype, instance_uuid and vclocks.
      
      It's needed in order to introduce checking of names inside the config
      module in the following commit.
      
      Needed for #8978
      
      @TarantoolBot document
      Title: xlog.meta(file-name) method
      
      Description: Open an xlog file, and return its meta block.
      Possible errors: Failed to open a file or it does not contain properly
      formatted meta block.
      
      Example:
      
      ```lua
      tarantool> xlog = require('xlog')
      ---
      ...
      
      tarantool> xlog.meta('00000000000000000000.snap')
      ---
      - filetype: SNAP
        prev_vclock: {}
        instance_uuid: 87b2e60f-275c-4efa-9b0e-e9562e309692
        vclock: {}
      ...
      ```
      145af72b
    • Nikita Zheleztsov's avatar
      config: move snapshot related code into utils · 21e9ef4b
      Nikita Zheleztsov authored
      Config's box.cfg applier scans snapshot_dir in order to find out,
      whether recovery is going to be done. It's needed in order to determine,
      whether the instance should be started into ro mode firstly.
      
      Let's move info about snapshot into separate file in utils. The commit
      also introduces snapshot_path, which will be used in the following
      commits in order to validate names.
      
      Needed for #8978
      
      NO_DOC=refactoring
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      21e9ef4b
  2. Oct 26, 2023
  3. Oct 24, 2023
    • Vladimir Davydov's avatar
      log: make log.cfg{modules=...} work as box.cfg{log_modules=...} · c13e59a5
      Vladimir Davydov authored
      Configuring log modules work differently with log.cfg and box.cfg:
      box.cfg{log_modules=...} overwrites the current config completely while
      log.cfg{modules=...} overwrites the currently config only for the
      specified modules. Let's fix this inconsistency by making log.cfg behave
      exactly as box.cfg.
      
      Closes #7962
      
      NO_DOC=bug fix
      c13e59a5
  4. Oct 23, 2023
    • Sergey Bronnikov's avatar
      Revert "third_party: update libcurl from 8.3.0 to 8.4.0" · b1779ccd
      Sergey Bronnikov authored
      This reverts commit 0ea1ba87.
      
      Bump is reverted due to regression in Curl 8.4.0.
      
      Needed for #9283
      
      NO_DOC=libcurl submodule bump
      NO_TEST=libcurl submodule bump
      NO_CHANGELOG=libcurl submodule bump
      b1779ccd
    • Sergey Ostanevich's avatar
      replication: relax rules box.cfg.*_name · ddaa5a32
      Sergey Ostanevich authored
      We decided to allow underscore in names to provide easier support
      for many existent installations.
      
      Closes #9148
      
      NO_CHANGELOG=no updates to the feature description
      NO_DOC=update existent doc tickets 3466, 3467, 3468
      ddaa5a32
    • Nikolay Shirokovskiy's avatar
      iproto: clean accounting of processed messages in input buffers · 9e918278
      Nikolay Shirokovskiy authored
      Message body resides in one of rotating input buffers for the
      connection. When we don't need message body anymore we advance the
      reading end of the input buffer by the size of the message. But message
      processing order can differ from the order of messages in the wire.
      Thus this advancing a bit hacky. Let's instead mark the data in the
      input buffer as read when we process all the messages in the input
      buffer. We cannot reuse the buffer any earlier anyway.
      
      Follow-up #7327
      
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      NO_DOC=refactoring
      9e918278
    • Nikolay Shirokovskiy's avatar
      misc: use ibuf API to discard/allocate/consume · 73832668
      Nikolay Shirokovskiy authored
      The API functions additionally poison related data in ASAN build.
      
      Follow-up #7327
      
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      NO_DOC=refactoring
      73832668
    • Nikolay Shirokovskiy's avatar
      small: bump version · ebafd684
      Nikolay Shirokovskiy authored
      New commits:
      
      - ibuf: change ibuf_consume_before argument type to const void ptr
      - ibuf: introduce ibuf_consume/ibuf_consume_before API
      - matras: fix matras_view::block_count overflow
      - slab: fix uint32_t overflow in slab_capacity
      - debug: add assertions of ASAN version to non ASAN
      - ibuf: add ibuf_discard
      - slab: fix NULL ptr deref in assertion in slab_get
      
      NO_TEST=submodule bump
      NO_CHANGELOG=submodule bump
      NO_DOC=submodule bump
      ebafd684
    • Nikolay Shirokovskiy's avatar
      test: increase expected selectG execution time for debug ASAN build · 703d11fe
      Nikolay Shirokovskiy authored
      The test is quite a flacky in debug ASAN CI workflow. The issue is test
      check upper boundary of it's execution time. I run many instances of
      this test on in parallel and got average time of 40s for memtex and 70s
      for vinyl.
      
      The time quota is already changed by the commit 84cb1e04 ("sql:
      increase time quota for selectG test on vinyl") for laptops with HDD.
      I did not check execution time for HDD though. I guess the bottleneck
      for debug ASAN is CPU.
      
      Follow-up #7327
      
      NO_CHANGELOG=internal
      NO_DOC=internal
      703d11fe
  5. Oct 20, 2023
    • Sergey Ostanevich's avatar
      replication: improve name conflict error message · 1b88f30a
      Sergey Ostanevich authored
      The error message was not quite clear in case instance has any name
      defined and config provides a different one.
      
      Closes #8692
      
      NO_CHANGELOG=no previous release with this error message
      NO_DOC=not needed since no changes to the public API
      1b88f30a
    • Vladimir Davydov's avatar
      fiber: use alternative signal stack · cb8e903b
      Vladimir Davydov authored
      We install a signal handler that prints the stack trace on SIGSEGV,
      SIGBUS, SIGILL, SIGFPE. The signal handler uses the current stack.
      This works fine for most issues, but not for stack overflow, because
      the latter makes the current stack unusable, leading to a crash in
      the signal handler. Let's install an alternative signal stack in each
      thread so that we can print the stack trace on stack overflow.
      
      Note that we skip this for ASAN because it installs its own signal
      stack. (Installing a custom stack would result in a crash.)
      
      Closes #9222
      
      NO_DOC=bug fix
      cb8e903b
    • Sergey Vorontsov's avatar
      ci: dockerize linux workflows · af996bbb
      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
      af996bbb
    • Magomed Kostoev's avatar
      util: introduce the ALWAYS_INLINE macro · d08f28df
      Magomed Kostoev authored
      The macro expands to inline keyword and always_inline attribute if
      it's supported. This attribute forces the compiler to inline the
      function if it's possible and raise a diagnostic if it's not.
      
      Needed for tarantool/tarantool-ee#580
      
      NO_DOC=internal
      NO_TEST=internal
      NO_CHANGELOG=internal
      d08f28df
  6. Oct 19, 2023
    • Gleb Kashkin's avatar
      config: unify logs and alerts inside creds applier · 26d508d1
      Gleb Kashkin authored
      With this patch the following log/alert structure is introduced:
      * all informational messages (e.g. some privs granted) use `log.verbose()`
      * all warnings about postponed apply use `config:_alert{type = 'warn'}`
      * all apply errors are reported with `config:_alert{type = 'error'}`
      
      Debug logs are removed.
      
      Part of #8967
      
      NO_DOC=logging and alerts
      NO_CHANGELOG=see NO_DOC
      NO_TEST=see NO_DOC
      26d508d1
    • Gleb Kashkin's avatar
      test: proceed with server on 'check_warnings' status · 1ee7020a
      Gleb Kashkin authored
      Before this patch luatest.server used to fail if the instance status
      was different from 'ready'. Now it allows 'check_warnings' state too.
      It is required to test legal corner cases inside config applier.
      
      Part of #8967
      
      NO_DOC=test helper update
      NO_TEST=see NO_DOC
      NO_CHANGELOG=see NO_DOC
      1ee7020a
    • Vladimir Davydov's avatar
      box: call tuple_free from box_free · 05751e6c
      Vladimir Davydov authored
      There are four problems we have to address to make this possible:
      
       1. memtx_engine_shutdown may delete the tuple referenced by
          box_tuple_last so that tuple_free, which is called later by
          box_free, will crash trying to free it. Fix this by clearing
          box_tuple_last in memtx_engine_shutdown.
      
       2. tuple_format_destroy and tuple_field_delete, called by it, expect
          all constraints to be detached. Let's destroy the constraints if
          this isn't the case. This effectively reverts commit 7a87b9a5
          ("box: do not call constraint[i].destroy() in
          tuple_field_delete()").
      
       3. tuple_field_delete, called by tuple_format_destroy, expects the
          default value function to be unpinned. Let's unpin it if this isn't
          the case. To avoid linking dependencies between the tuple and box
          libraries, we have to introduce a virtual destructor for
          field_default_func.
      
       4. The tuple_format unit test calls tuple_free after box_free. If
          box_free calls tuple_free by itself, this leads to a crash. Fix this
          by removing tuple_free and tuple_init calls from the test.
      
      Closes #9174
      
      NO_DOC=code health
      NO_CHANGELOG=code health
      NO_TEST=checked by existing tests
      05751e6c
  7. Oct 18, 2023
  8. Oct 17, 2023
    • Nikolay Shirokovskiy's avatar
      app: start init script event loop explicitly · 1fcfb8c2
      Nikolay Shirokovskiy authored
      The motivation is to reduce time slip on Tarantool startup before
      running init scripts. Internal ev time is set in fiber_init/ev_default_loop
      and is not get updated until starting event loop. This causes
      timeouts slip up to 0.3 in debug ASAN build in init script (see #9261).
      
      Let's run event loop right at the beginning of the run_script_f before
      executing any script. This way besides updating internal ev time we make
      an explicit place of starting script event loop. Currently it is started
      lazily when config script yields.
      
      This will fix CI for PR https://github.com/tarantool/tarantool-ee/pull/572
      for debug ASAN workflow.
      
      We can also remove start_loop condition. It does not make sense now. It
      was added in the commit 3a851430 ("Fix tarantool -e "os.exit()"
      hang") but since then we start to stop event loop after handling
      os.exit().
      
      Also this fixes #9266. The issue is we don't have an event loop to run
      on shutdown triggers if -e command line expression add such a trigger
      and then call os.exit().
      
      Follow-up #7327
      Closes #9266
      
      NO_DOC=bugfix
      1fcfb8c2
  9. Oct 16, 2023
    • Vladimir Davydov's avatar
      console: forward original URI to net.box when connecting over IPROTO · 33e72567
      Vladimir Davydov authored
      Tarantool supports two console protocols: text and binary. The binary
      protocol is implemented with IPROTO EVAL request so the console module
      reuses the net.box module to establish and maintain a binary connection.
      Currently, instead of passing the original URI specified by the user to
      net.box.connect as is, the console module parses the URI and passes the
      host and port. As a result, extra information that may be specified in
      URI parameters is lost. This prevents the user from connecting to the
      binary console using the SSL transport because to use the SSL transport
      the user must specify transport=ssl URI parameter.
      
      Needed for tarantool/tarantool-ee#567
      
      NO_DOC=no visible changes in CE
      NO_TEST=no visible changes in CE
      NO_CHANGELOG=no visible changes in CE
      33e72567
  10. Oct 13, 2023
    • Gleb Kashkin's avatar
      config: update password hashes after auth_type change · 952d1582
      Gleb Kashkin authored
      User password is stored in a system space is a form of hash when
      'chap-sha1' auth type is set, and in a form of hash with salt when
      'pap-sha256' is set.
      
      Now, if a user is set inside config, and the current auth type is
      different from the type the users password is stored in, the password
      hash will be regenerated.
      
      Part of #8967
      
      NO_DOC=documentation request will be filed manually for the whole
             credentials
      952d1582
    • Gleb Kashkin's avatar
      config: add lua_eval, lua_call and sql support to creds · a21c0e6a
      Gleb Kashkin authored
      With #8906 the object types mentioned above were introduced. They control
      access to code execution over IPROTO.
      This patch adds such object types support to credentials applier. Now
      'execute' can be granted to a user or role for 'lua_eval', 'lua_call' and
      'sql'. Note that similar to 'universe', objects can't be specified in
      the config, only 'all' is allowed.
      
      Part of #8967
      
      NO_DOC=documentation request will be filed manually for the whole
             credentials
      a21c0e6a
    • Vladimir Davydov's avatar
      config: add audit_spaces and audit_extract_key parameters · 09565445
      Vladimir Davydov authored
      The new parameters will be implemented in Tarantool Enterprise Edition.
      This commit just adds configuration stubs.
      
      Needed for tarantool/tarantool-ee#502
      Needed for tarantool/tarantool-ee#503
      
      NO_DOC=stubs for enterprise edition
      NO_CHANGELOG=stubs for enterprise edition
      09565445
    • Vladimir Davydov's avatar
      audit: rework configuration function · 138a4bfa
      Vladimir Davydov authored
      Let's obtain box.cfg parameters from audit_log_init with cfg_get instead
      of passing them as arguments, like we do with the security module, for
      example. This simplifies addition of new audit log parameters.
      
      Needed for tarantool/tarantool-ee#502
      Needed for tarantool/tarantool-ee#503
      
      NO_DOC=refactoring
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      138a4bfa
    • Ilya Verbin's avatar
      box: fix space:bsize() handling on space alter · 54a42186
      Ilya Verbin authored
      During building an index in background, some transaction can perform a dml
      request that affects space size (e.g. a replace), but the size will remain
      the same, because bsize is moved from the old space to the new space in
      memtx_space_prepare_alter() prior to space_execute_dml(). Fix this issue by
      calling space_finish_alter() in alter_space_do().
      In fact, this patch partially reverts commit 9ec3b1a4 ("alter: zap
      space_vtab::commit_alter").
      
      NO_DOC=bugfix
      
      Closes #9247
      54a42186
Loading