Skip to content
Snippets Groups Projects
  1. Aug 25, 2023
  2. Aug 24, 2023
    • Ilya Verbin's avatar
      box: fix memory leak on error_unpack_unsafe() failure · b367fb98
      Ilya Verbin authored
      Memory is leaked in the following scenario:
      - MP_ERROR_STACK with 2 errors is passed to error_unpack_unsafe():
        1. A correct MP_MAP with MP_ERROR_* fields;
        2. Something unexpected, e.g. MP_INT;
      - This first call to mp_decode_error_one() allocates memory for the first
        error in error_build_xc() -> `new ClientError()`;
      - The second call to mp_decode_error_one() returns NULL, and
        error_unpack_unsafe() returns NULL too. Memory from the previous step
        is leaked.
      
      Closes #8921
      
      NO_DOC=bugfix
      b367fb98
    • Andrey Saranchin's avatar
      lua: introduce module trigger · 7f392d75
      Andrey Saranchin authored
      The patch introduces Lua module trigger, which allows to set, delete and
      call triggers from event registry.
      
      Closes #8656
      
      NO_DOC=later
      7f392d75
    • Andrey Saranchin's avatar
      lua: introduce func_adapter_lua_get_func method · dba0ec0d
      Andrey Saranchin authored
      Future module trigger will allow user to call triggers from Lua. We have
      function adapter to call an abstract function from any language, but
      it's convenient to call Lua functions directly when they are called from
      Lua, so let's add a method that allows to get underlying Lua function (or
      another callable object).
      
      NO_CHANGELOG=internal
      NO_DOC=internal
      dba0ec0d
    • Andrey Saranchin's avatar
      core: introduce event subsystem · 5e890b6a
      Andrey Saranchin authored
      The patch introduces new event subsystem. This subsystem is designed to
      store user-defined triggers and has nothing in common with core triggers.
      
      Each trigger has its own name and is represented by func_adapter.
      Triggers are stored in events - named wrappers over rlist. Event objects
      are opaque, hence rlist field should not be used directly - event
      provides event_find_trigger, event_reset_triggers methods and
      event_trigger_iterator. Iterator provides stable iteration and all the
      non-deleted triggers will surely be traversed.
      
      On way to the goal this patch also fixes include list in func_adapter.h.
      
      Part of #8656
      
      NO_CHANGELOG=internal
      NO_DOC=internal
      5e890b6a
    • Ilya Verbin's avatar
      box: validate key_def->part_count prior to memory allocation · ef9e3320
      Ilya Verbin authored
      part_count was checked in index_def_check(), which was called too late.
      Before that check:
      1. `malloc(sizeof(*part_def) * part_count)` can fail for huge part_count;
      2. key_def_new() can crash for zero part_count because of out of bound
         access in:
      
      NO_WRAP
         - #1 key_def_contains_sequential_parts (def=0x5555561a2ef0) at src/box/tuple_extract_key.cc:26
         - #2 key_def_set_extract_func (key_def=0x5555561a2ef0) at src/box/tuple_extract_key.cc:442
         - #3 key_def_set_func (def=0x5555561a2ef0) at src/box/key_def.c:162
         - #4 key_def_new (parts=0x7fffc4001350, part_count=0, for_func_index=false) at src/box/key_def.c:320
      NO_WRAP
      
      Closes #8688
      
      NO_DOC=bugfix
      ef9e3320
    • Vladislav Shpilevoy's avatar
      election: fix box.ctl.demote() nop in off-mode · 1afe2274
      Vladislav Shpilevoy authored
      box.ctl.demote() used not to do anything with election_mode='off'
      if the synchro queue didn't belong to the caller in the same term
      as the election state.
      
      The reason could be that if the synchro queue term is "outdated",
      there is no guarantee that some other instance doesn't own it in
      the latest term right now.
      
      The "problem" is that this could be workarounded easily by just
      calling promote + demote together.
      
      There isn't much sense in fixing it for the off-mode because the
      only reasons off-mode exists are 1) for people who don't use
      synchro at all, 2) who did use it and want to stop. Hence they
      need demote just to disown the queue.
      
      The patch "legalizes" the mentioned workaround by allowing to
      perform demote in off-mode even if the synchro queue term is old.
      
      Closes #6860
      
      NO_DOC=bugfix
      1afe2274
  3. Aug 23, 2023
    • Sergey Bronnikov's avatar
      ci: update paths in a publish module api doc workflow · 9af36ae1
      Sergey Bronnikov authored
      Module API documentation is described in Doxygen comments in C/C++ files
      in src/ directory. No sense to run this job for other changes. The patch
      changes paths in workflow accordingly.
      
      NO_CHANGELOG=ci
      NO_DOC=ci
      NO_TEST=ci
      9af36ae1
    • Sergey Bronnikov's avatar
      ci: update paths in a fuzzing workflow · f14cb97d
      Sergey Bronnikov authored
      Fuzzing is a heavyweight job, we can reduce a set of paths used for
      triggering this job and therefore reduce an overall time of testing in
      some cases.
      
      The patch replaces `.github/workflows/**` to
      `.github/workflows/fuzzing.yml` because workflows are independent and
      changes in other workflows does not affect fuzzing at all and patch adds
      Lua files (`**.lua`) to ignores because fuzzing focused on C/C++ code.
      
      NO_CHANGELOG=ci
      NO_DOC=ci
      NO_TEST=ci
      f14cb97d
    • Aleksandr Lyapunov's avatar
      sql: refactor update_view_references a bit · 392fe93a
      Aleksandr Lyapunov authored
      The function update_view_references is called when an SQL view
      is created or dropped. The goal of this function is to modify
      (increment or decrement) view_ref_count member of spaces that
      the view references.
      
      There were a several issues that deserves to be refactored:
      * By design in case of error it left the job partially done, so
        some space references were modified while some other - not.
        Although there was no bug since special steps were made in case
        of error, this pattern is inconvenient and should be avoided.
      * In case of error the failing space name was returned via special
        argument which is not flexible and even requires allocation.
      * Another argument - suppress_error - has actually never
        suppressed any error because the only case when an error could
        occur is creation of a view, which used suppress_error = false.
      * Fail of that function was not actually covered with tests.
      
      So this commit:
      * Makes the function to do all or nothing.
      * Forces the function to set diag by itself in case of error.
      * Removes suppress_error argument while adding several asserts.\
      * Adds a small test that fulfills coverage.
      
      NO_DOC=refactoring
      NO_CHANGELOG=reafactoring
      392fe93a
    • Aleksandr Lyapunov's avatar
      sql: don't store the first NULL element in list · 5ae43c6e
      Aleksandr Lyapunov authored
      By design a newly created SrcList object contains one element
      with NULL name. That was confusing and led to strange NULL checks
      in a list that could not contain NULL names.
      
      Fix it by clearing the list before usage.
      
      NO_DOC=refactoring
      NO_CHANGELOG=reafactoring
      NO_TEST=refactoring
      5ae43c6e
    • Aleksandr Lyapunov's avatar
      sql: don't catch OOM in sql_select_expand_from_tables · 0e451c98
      Aleksandr Lyapunov authored
      Since we panic on OOM now, no OOM error handling is needed now.
      Fix both internals of the function and how it is used in alter.
      
      NO_DOC=refactoring
      NO_CHANGELOG=reafactoring
      NO_TEST=refactoring
      0e451c98
    • Vladimir Davydov's avatar
      msgpack: remove dead code handling invalid MP_EXT · a85502d9
      Vladimir Davydov authored
      We have a few functions that decode MsgPack data assuming it was
      previously checked with mp_check(). This means it's safe to expect
      that MP_EXT contains valid data because we install a custom checker
      for MP_EXT in msgpack_init. So let's replace errors with assertions,
      removing the dead code.
      
      NO_DOC=code cleanup
      NO_TEST=code cleanup
      NO_CHANGELOG=code cleanup
      a85502d9
    • Vladimir Davydov's avatar
      util: add VERIFY macro · bfd2a20d
      Vladimir Davydov authored
      The new macro is like assert, but it evaluates the checked expression
      even in the release mode.
      
      NO_DOC=internal
      NO_TEST=internal
      NO_CHANGELOG=internal
      bfd2a20d
    • Kirill Yukhin's avatar
      Generate changelog for 3.0.0-alpha2 · 7f4c9158
      Kirill Yukhin authored
      NO_DOC=no code changes
      NO_TEST=no code changes
      NO_CHANGELOG=no code changes
    • Alexander Turenko's avatar
      test/config: adjust initial permissions in a test · 261a21bd
      Alexander Turenko authored
      The test gives some initial permissions for a newly created user. Then,
      it synchronizes the permissions with ones that are given in the new
      configuration format. The resulting permissions should be the same as
      described in the configuration (plus defaults).
      
      The code that grants the initial permissions has a typo in one of the
      permission descriptions, so it is not granted (and this error is
      silently ignored). It doesn't affect the test case successfulness,
      because this permission is anyway expected to be revoked by the
      synchronization.
      
      The patch fixes the initial privilege granting code and makes the test
      actually verifying that the given permission is revoked.
      
      Part of #8967
      
      NO_DOC=It is a fix of a test.
      NO_CHANGELOG=see NO_DOC
      261a21bd
    • Alexander Turenko's avatar
      test/config: temporary disable pap-sha256 test cases · ee95ad82
      Alexander Turenko authored
      They're failing on Tarantool EE, because pap-sha256 requires to setup a
      secure connection. The test doesn't do that.
      
      The test is to be updated later. Now, just disable these test cases.
      
      Part of #8967
      
      NO_DOC=A testing change.
      NO_CHANGELOG=see NO_DOC
      ee95ad82
    • Alexander Turenko's avatar
      test/config: disable hide/show prompt in a test · bc444691
      Alexander Turenko authored
      The hide/show prompt console functionality sometimes breaks the
      `config-luatest/credentials_applier` test. The patch disables it for
      affected test cases. See a comment in the test for details.
      
      Part of #8967
      
      NO_DOC=It is a fix of a test.
      NO_CHANGELOG=see NO_DOC
      bc444691
    • Alexander Turenko's avatar
      test: accept env in interactive_tarantool.new() · 130335e4
      Alexander Turenko authored
      It is needed to fix a problem in the
      `config-luatest/credentials_applier` test. See the next commit.
      
      NO_DOC=It is a testing helper improvement.
      NO_CHANGELOG=see NO_DOC
      NO_TEST=see NO_DOC
      130335e4
    • Alexander Turenko's avatar
      test/config: adjust expected default wal.dir path · 4b8bbe87
      Alexander Turenko authored
      It was forgotten in commit 6712ab9a ("config: change default paths
      to var/<...>"). Overlooked, because the test case is to be run only on
      Tarantool EE.
      
      Part of #8862
      
      NO_DOC=It is a fix of a testing problem.
      NO_CHANGELOG=see NO_DOC
      4b8bbe87
    • Alexander Turenko's avatar
      test/config: fix password format in etcd example · 7aceb82b
      Alexander Turenko authored
      The instance config schema was changed in commit 4bb1eb0e ("config:
      remove hashes from credentials.password"), but an example of a config
      for etcd was not updated.
      
      The example is tested on Tarantool EE, so we should update it to fix the
      testing failure.
      
      Part of #8967
      
      NO_DOC=It is a fix of the testing problem.
      NO_CHANGELOG=see NO_DOC
      NO_TEST=It is a fix of a test in fact.
      7aceb82b
    • Mergen Imeev's avatar
      config: introduce example for sharding · 6cfb54f7
      Mergen Imeev authored
      Follow-up #9007
      
      NO_DOC=Will be described when full support for vshard is introduced.
      NO_CHANGELOG=Addition of an example.
      6cfb54f7
    • Vladimir Davydov's avatar
      Bump msgpuck submodule · bc55ccea
      Vladimir Davydov authored
      This update pulls the following commits:
      
      * Add mp_check_on_error callback
      * Make test output TAP compatible
      
      It also drops the msgpack test result file because the test was switched
      to the TAP compatible format.
      
      Needed for #7968
      
      NO_DOC=internal
      NO_CHANGELOG=internal
      bc55ccea
  4. Aug 22, 2023
    • Mergen Imeev's avatar
      config: introduce initial support of vshard · 24084239
      Mergen Imeev authored
      This patch introduces initial support for the vshard configuration.
      There is still a lot to be done in both vshard and the config to be able
      to run vshard naturally. Key support restrictions introduced in the
      patch:
      1) at the moment there are only two roles: storage and router;
      2) the entire config is considered a configuration for one sharded
      system;
      3) the rebalancer is currently disabled;
      4) The router can automatically find all masters, but once all masters
      are found, any changes to the masters will be ignored until
      vshard.router.cfg() is called manually.
      
      Closes #9007
      
      NO_DOC=Will be described when full support for vshard is introduced.
      24084239
    • Mergen Imeev's avatar
      config: introduce sharding options · 4a2476aa
      Mergen Imeev authored
      This patch introduces all sharding parameters except "weight".
      
      Part of #9007
      
      NO_DOC=Will be described when full support for vshard is introduced.
      4a2476aa
    • Mergen Imeev's avatar
      config: move URI compiling instance_config · e670f92b
      Mergen Imeev authored
      This patch moves the code that compiles iproto.advertise.peer to
      instance_config. This will allow us to use this function for
      iproto.advertise.sharding.
      
      Part of #9007
      
      NO_DOC=refactoring
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      e670f92b
    • Alexander Turenko's avatar
      config: add config's dir to module search paths · f1ea5e52
      Alexander Turenko authored
      It is convenient for development environments, when the configuration
      file and the application sources reside in the same directory.
      
      The same logic was recently implemented for the main script, see #8182.
      The same problems appears in context of startup from a configuration
      file, so it seems meaningful to adjust module search paths in this case
      too.
      
      Part of #8862
      
      NO_DOC=This change is too minor to describe in the documentation issue
             https://github.com/tarantool/doc/issues/3544. I'll work with the
             documentation team regarding details of startup/reload flow and
             we'll determine what should go to the user documentation and what
             shouldn't.
      f1ea5e52
    • Alexander Turenko's avatar
      config: change default paths to var/<...> · 6712ab9a
      Alexander Turenko authored
      The new default directory layout is the following.
      
      ```
      + var/
        + lib/
          + instance-001/
            - *.xlog
            - *.snap
            - *.vylog
        + log/
          + instance-001/
            - tarantool.log
        + run/
          + instance-001/
            - tarantool.control
            - tarantool.pid
      ```
      
      Our guess is that it should be convenient for development environments,
      when the application consists of several instances. The idea is borrowed
      from the `cartridge-cli` and `tt` tools.
      
      We plan to synchronize these defaults with the `tt` tool, to simplify
      cases, when pure tarantool (without `tt`) should be run in the
      directories layout created by `tt`. It should simplify debugging using
      `gdb`, `strace` and other tools.
      
      Also, it should reduce possible confusion for users of `cartridge-cli`
      and `tt`.
      
      Part of #8862
      
      NO_DOC=https://github.com/tarantool/doc/issues/3544 already points to
             the actual instance config schema
      6712ab9a
    • Alexander Turenko's avatar
      config: create dirs relative to process.work_dir · fb734be0
      Alexander Turenko authored
      The current working directory of a tarantool process is changed during
      startup to `process.work_dir`.
      
      The mkdir applier works before and after this point, so it should take
      into account both situations.
      
      Before first box.cfg() call (in the box_cfg applier) it should prepend
      directories with `process.work_dir`. However, it shouldn't do that after
      the current wordking directory change.
      
      Part of #8862
      
      NO_DOC=It is bugfix.
      fb734be0
    • Alexander Turenko's avatar
      config: create process.work_dir before box.cfg() · f1a09989
      Alexander Turenko authored
      The `process.work_dir` option can be set in the configuration. All the
      other directories/files has the before-box-cfg creation logic and it
      seems meaningful to support it for `process.work_dir` too.
      
      Part of #8862
      
      NO_DOC=This change is too minor to describe in the documentation issue
             https://github.com/tarantool/doc/issues/3544. I'll work with the
             documentation team regarding details of startup/reload flow and
             we'll determine what should go to the user documentation and what
             shouldn't.
      f1a09989
    • Alexander Turenko's avatar
      config: create parent directory for log file · 4aa51f7d
      Alexander Turenko authored
      For example, if we want the logs to be in a separate `var/log`
      directory, it is convenient to just configure it as `var/run/{{
      instance_name }}.log` and let tarantool create the parent directory.
      
      Part of #8862
      
      NO_DOC=This change is too minor to describe in the documentation issue
             https://github.com/tarantool/doc/issues/3544. I'll work with the
             documentation team regarding details of startup/reload flow and
             we'll determine what should go to the user documentation and what
             shouldn't.
      4aa51f7d
    • Alexander Turenko's avatar
      config: create parent directory for console socket · 78ee35c0
      Alexander Turenko authored
      For example, if we want the console socket to be in a separate `var/run`
      directory, it is convenient to just configure it as `var/run/{{
      instance_name }}.control` and let tarantool create the parent directory.
      
      Part of #8862
      
      NO_DOC=This change is too minor to describe in the documentation issue
             https://github.com/tarantool/doc/issues/3544. I'll work with the
             documentation team regarding details of startup/reload flow and
             we'll determine what should go to the user documentation and what
             shouldn't.
      78ee35c0
  5. Aug 21, 2023
    • Alexander Turenko's avatar
      config: create parent directories in mkdir applier · 38a70e41
      Alexander Turenko authored
      Before this patch an attempt to set, say, `wal.dir` option to a
      non-existent directory `foo` succeeds, while the same with `foo/bar`
      directory fails.
      
      The patch removes a race condition check, because `fio.mktree()`
      performs the check on its own. See #4660 for details.
      
      Part of #8862
      
      NO_DOC=It is a bugfix.
      38a70e41
    • Alexander Turenko's avatar
      config: don't persist group name as cluster_name · 07e6060b
      Alexander Turenko authored
      We agreed that it is up to a user how to draw a line between one set of
      instances that is considered as a separate cluster and another set of
      instances that is assumed as a different cluster. This line is virtual
      and there is no sense to impose restrictions until we add some certain
      (and consistent) semantic to word 'cluster' in context of tarantool.
      
      Part of #8862
      
      NO_DOC=There is an existing documentation request
             https://github.com/tarantool/doc/issues/3544 and it doesn't
             describe such details. I'll work with the documentation team on
             demand on all the necessary details anyway.
      07e6060b
    • Gleb Kashkin's avatar
      config: upgrade password sync · 250185e6
      Gleb Kashkin authored
      Before this patch, user password could be set or updated only for
      auth_type == 'chap-sha1'. Now password can be set, updated or removed
      for any auth_type. Note that the password is changed only if necessary
      to minimise db writes.
      
      Part of #8967
      
      NO_DOC=tarantool/doc#3544 links the most actual schema,
             no need to update the issue.
      250185e6
Loading