Skip to content
Snippets Groups Projects
  1. Aug 31, 2022
    • Nikolay Shirokovskiy's avatar
      box: fix accidental exposure of _collation space to public · b771a5bf
      Nikolay Shirokovskiy authored
      'public' role and thus guest and any newly created user has 'write'
      privilege to _collation space. It is not enough to modify _collation as
      one also needs 'create' privilege to add a collation and 'drop privilege
      to delete one. So it is safe. Yet looks like we don't have any purpuse
      of exposing _collation now.
      
      NO_DOC=bugfix
      b771a5bf
    • Nikolay Shirokovskiy's avatar
      box: fix unauthorized inserts into _truncate table · 941318e7
      Nikolay Shirokovskiy authored
      Non privileged user (thru public role) has write access to _truncate
      table in order to be able to perform truncates on it's tables. Normally
      it should be able to modify records only for the tables he has write
      access. Yet now due to bootstrap check it is not so.
      
      Closes tarantool/security#5
      
      NO_DOC=bugfix
      941318e7
    • Nikolay Shirokovskiy's avatar
      box: make part simplicity check easier · bc0872fd
      Nikolay Shirokovskiy authored
      Simple part is a part without any extra key besides 'field' and 'type'.
      Let's make a check in try_simplify_index_parts itself.
      
      NO_TEST=refactoring
      NO_DOC=refactoring
      NO_CHANGELOG=refactoring
      bc0872fd
    • Nikolay Shirokovskiy's avatar
      box: fix inheriting format options for old-style parts · 91ba0a59
      Nikolay Shirokovskiy authored
      If index parts are specified using old syntax like:
      
      	parts = {1, 'number', 2, 'string'},
      
      then (except if parts count is 1) index options set in space format
      are not taken into account. Solution is to continue after parsing 1.6.0
      style parts so to use code that check format options.
      
      Closes #7614
      
      NO_DOC=bugfix
      91ba0a59
    • Alexander Turenko's avatar
      ci: make module.h generation command more specific · 9a3c49a5
      Alexander Turenko authored
      `make api` generates `src/module.h`. `make module_api` is the target for
      compiling a library for testing of the module API:
      `test/app-tap/module_api.so`. It depends on the `api` target.
      
      Both works for generating `module.h`, but `make api` don't do extra
      unneeded actions.
      
      NO_DOC=Not a user visible change.
      NO_TEST=It is CI workflow. It would be too strong to test each part of
              the testing/deployment infrastructure.
      NO_CHANGELOG=Not a user visible change.
      9a3c49a5
  2. Aug 30, 2022
    • Vladimir Davydov's avatar
      Add stubs for read view Lua API · 0b622ac1
      Vladimir Davydov authored
       - Mix-in EE Lua sources if ENABLE_READ_VIEW is set.
       - Raise an error on attempt to access box.read_view in CE.
      
      Needed for https://github.com/tarantool/tarantool-ee/issues/139
      
      NO_DOC=internal
      NO_CHANGELOG=internal
      0b622ac1
    • Vladimir Davydov's avatar
      Store space names in database read view · 9f77b4a4
      Vladimir Davydov authored
      We need to know space names to export a database read view to Lua.
      
      Needed for https://github.com/tarantool/tarantool-ee/issues/139
      
      NO_DOC=internal
      NO_TEST=ee
      NO_CHANGELOG=internal
      9f77b4a4
    • Nikita Zheleztsov's avatar
      core: mark some internal fibers as system ones · 3733ff25
      Nikita Zheleztsov authored
      Currently internal tarantool fibers can be cancelled from the user's app,
      which can lead to critical errors.
      
      Let's mark these fibers as a system ones in order to be sure that they
      won't be cancelled from the Lua world.
      
      Closes #7448
      Closes #7473
      
      NO_DOC=minor change
      3733ff25
    • Nikita Zheleztsov's avatar
      core: introduce system fiber · 3a18a9bf
      Nikita Zheleztsov authored
      There are a number of internal system fibers which are not supposed to
      be cancelled.
      
      Let's introduce `FIBER_IS_SYSTEM` flag that will indicate, if the fiber
      can be explicitly killed. If this flag is set, killing functions will
      just ignore cancellation request.
      
      This commit introduce blocking system fiber cancelling only from the Lua
      public API, as it is more important to have it right. The prohibition to
      cancel fibers from C API will be introduced later.
      
      Related to #7448
      Part of #7473
      
      NO_DOC=internal
      NO_TEST=will be added in subsequent commit
      NO_CHANGELOG=internal
      3a18a9bf
  3. Aug 26, 2022
    • Yaroslav Lobankov's avatar
      ci: use `ubuntu-latest` instead of `ubuntu-18.04` · 4572a584
      Yaroslav Lobankov authored
      The `ubuntu-18.04` environment is deprecated, so let's switch to
      `ubuntu-latest` where it is safe. For more details see [1].
      
      [1] https://github.com/actions/virtual-environments/issues/6002
      
      NO_DOC=ci
      NO_TEST=ci
      NO_CHANGELOG=ci
      4572a584
    • Nikita Pettik's avatar
      perf: introduce Light benchmark · 9818bba4
      Nikita Pettik authored
      Benchmark is implemented using Google Benchmark lib. Here's benchmark
      settings:
       - values: we use structure (tuple) containing pointer to heap memory
                 and size (all payload is of the same size - 32 bytes);
       - keys: unsigned char (first byte in the tuple memory);
       - hash function: FNV-1a;
       - value comparator: std::memcmp();
       - value count: 10k - 100k - 1M
      
      Before each test we prepare vector of tuples storing truly random
      values.
      
      Here's the list of results obtained on my PC (i7-8700 12 X 4600 MHz):
      
      Insertions: ~20-12M per second;
      Find (no misses): ~58-16M* per second (find by key gives the same result);
      Find (many misses): ~84-30M per second;
      Iteration with dereference: ~450M per second;
      Insertions after erase: ~50-17M* per second;
      Find after erase: ~52-17M* per second (the same as without erase);
      Delete: ~32-8M* per second.
      
      * The first value is for 10k values in hash table; second - is for 1M.
      
      Just to have some baseline here results for quite similar benchmark for
      std::unordered_map (it is also included in source file):
      
      Insertions: ~26-8M per second;
      Find (no misses): ~44-11M per second;
      Iteration with dereference: ~265-56M per second;
      Find after erase: ~37-13M per second.
      
      Part of #7338
      
      NO_TEST=<Benchmark>
      NO_DOC=<Benchmark>
      NO_CHANGELOG=<Benchmark>
      9818bba4
    • Nikita Pettik's avatar
      perf: use C++ 14 standard · e48835fd
      Nikita Pettik authored
      There are a lot of pretty things introduced in 14 standard,
      so let's use it.
      
      NO_DOC=<Build change>
      NO_TEST=<Build change>
      NO_CHANGELOG=<Build change>
      e48835fd
    • Nikita Pettik's avatar
      perf: move debug warning to a separate header · 0a7764a7
      Nikita Pettik authored
      It's useful and can be used in all performance tests, so let's move it
      to a separate header.
      
      NO_TEST=<Refactoring>
      NO_DOC=<Refactoring>
      NO_CHANGELOG=<Refactoring>
      0a7764a7
    • Mergen Imeev's avatar
      sql: introduce SQL_EXPR functions · 0dea6493
      Mergen Imeev authored
      This patch introduces the SQL_EXPR functions. These functions are SQL
      functions that consist of only one expression. Currently, the only way
      to use these functions is as a function in a CHECK constraint, since
      there is no interface to define the function's arguments.
      
      Part of #6986
      
      NO_DOC=will be added later
      NO_CHANGELOG=will be added later
      0dea6493
    • Mergen Imeev's avatar
      sql: introduce new parsing rule · d882d9f4
      Mergen Imeev authored
      This commit introduces a new parse rule for compiling an unresolved
      single expression. This simplifies the current implementation of
      sql_expr_compile() and is useful for generating SQL expressions that can
      be used in the core check constraint. This rule is for internal use
      only.
      
      Part of #6986
      
      NO_DOC=will be added later
      NO_TEST=refactoring
      NO_CHANGELOG=will be added later
      d882d9f4
    • Mergen Imeev's avatar
      box: introduce port_c_get_msgpack() · 19448bd1
      Mergen Imeev authored
      This patch introduces get_msgpack() method for port_c. After this patch
      C-functions could be used for check-constraints.
      
      Needed for #6986
      
      NO_DOC=will be added later
      NO_CHANGELOG=will be added later
      19448bd1
    • Mergen Imeev's avatar
      sql: move struct port_sql definition to sql/port.h · e83e00a6
      Mergen Imeev authored
      Needed for #6896
      
      NO_DOC=refactoring
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      e83e00a6
  4. Aug 25, 2022
    • Aleksandr Lyapunov's avatar
      Fix a bug in qsort · e1d96170
      Aleksandr Lyapunov authored
      In commit (35334ca1) qsort was fixed but unfortunately a small
      typo was introduced. Due to that typo the qsort made its job wrong.
      
      Fix the problem and add unit test for qsort.
      
      Unfortunately the test right from the issue runs extremely long,
      so it should go to long-tests.
      
      Closes #7605
      
      NO_DOC=bugfix
      e1d96170
    • Nikita Pettik's avatar
      say: get rid of say_log_level() macro family · fbfa5aaf
      Nikita Pettik authored
      It is unused and misleading. Let's remove them so that now we have
      single entry point for log subsystem - `say()`.
      
      NO_DOC=<Refactoring>
      NO_CHANGELOG=<Refactoring>
      NO_TEST=<Refactoring>
      fbfa5aaf
    • Nikita Pettik's avatar
      say: introduce on_log_level routines · 3d39d23a
      Nikita Pettik authored
      Let's introduce on_log_level static variable which is assumed to be
      configured in `say_set_log_callback()`. on_log_level is assumed to be
      log level of `log->on_log` callback (i.e. if entry to be logger features
      higher log level - it is simply skipped). Note that now casual log_level
      is calculated as MAX(level, on_log_level) since log_level is the single
      guard for passing execution flow to `log_vsay()` where both things (to
      be precise on_log callback invocation and ordinary logging) happens.
      
      This change is required since if log_level has lower magnitude than
      on_log_level - on_log callback will be skipped.
      
      NO_DOC=<Internal change>
      NO_TEST=<Internal change>
      NO_CHANGELOG=<Internal change>
      3d39d23a
    • Serge Petrenko's avatar
      core: fix crashes after altering trigger list while it is run · 607cb553
      Serge Petrenko authored
      This patch fixes a number of issues with trigger_clear() while the
      trigger list is being run:
      1) clearing the next-to-be-run trigger doesn't prevent it from being run
      2) clearing the next-to-be-run trigger causes an infinite loop or a
         crash
      3) swapping trigger list head before the last trigger is run causes an
         infinite loop or a crash (see space_swap_triggers() in alter.cc, which
         had worked all this time by miracle: space _space on_replace trigger
         swaps its own head during local recovery, and that had only worked
         because the trigger by luck was the last to run)
      
      This is fixed by adding triggers in a separate run list on trigger_run.
      This list may be iterated by `rlist_shift_entry`, which doesn't suffer
      from any of the problems mentioned above.
      
      While being bad in a number of ways, old approach supported practically
      unlimited number of concurrent trigger_runs for the same trigger list.
      The new approach requires the trigger to be in as many run lists as
      there are concurrent trigger_runs, which results in quite a big
      refactoring.
      
      Add a luatest-based test and a unit test.
      
      Closes #4264
      
      NO_DOC=bugfix
      607cb553
    • Serge Petrenko's avatar
      core: add a trigger initializer macro · 2040d1f9
      Serge Petrenko authored
      struct trigger is about to get a new field, and it's mandatory that this
      field is specified in all initializers. Let's introduce a macro to avoid
      adding every new field to all the initializers and at the same time keep
      the benefits of static initialization.
      
      Also while we're at it fix `lbox_trigger_reset` setting all trigger
      fileds manually.
      
      Part-of #4264
      
      NO_DOC=refactoring
      NO_CHANGELOG=refactoring
      NO_TEST=refactoring
      2040d1f9
    • Serge Petrenko's avatar
      core: refactor trigger_fiber_run · ca59d305
      Serge Petrenko authored
      Make trigger_fiber_run return an error, when it occurs, so that the
      calling code decides how to log it.
      Also, while I'm at it, simplify trigger_fiber_run's code a bit.
      
      In-scope-of #4264
      
      NO_DOC=refactoring
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      ca59d305
    • Serge Petrenko's avatar
      core: introduce cord_exit() function · 35b724c0
      Serge Petrenko authored
      cord_exit should be always called in the exiting thread. It's a single
      place to call all the thread-specific module deinitalization routines.
      
      In-scope-of #4264
      
      NO_DOC=refactoring
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      35b724c0
    • Serge Petrenko's avatar
      test: make unit.h self sufficient · b9fd4557
      Serge Petrenko authored
      Unit test compilation with `#define UNIT_TAP_COMPATIBLE 1` might fail
      with an error complaining that <stdarg.h> is not included. Fix this.
      
      In-scope-of #4264
      
      NO_CHANGELOG=testing stuff
      NO_DOC=testing stuff
      b9fd4557
    • Serge Petrenko's avatar
      core: add a test for recursive trigger invocation · bf852b41
      Serge Petrenko authored
      Our triggers support recursive invocation: for example, an on_replace
      trigger on a space may do a replace in the same space.
      
      However, this is not tested and might get broken easily. Let's add a
      corresponding test.
      
      In-scope-of #4264
      
      NO_DOC=testing
      NO_CHANGELOG=testing
      bf852b41
    • Vladimir Davydov's avatar
      index: add index_read_view get method · 742de9bf
      Vladimir Davydov authored
      We will use it in the read view Lua API. For memtx tree and hash
      indexes, we add a stub function with a possibility of override if
      ENABLE_READ_VIEW is set. For the sequence data space, we raise an
      error if this function is called, because we aren't planning to
      implement it in the EE repository.
      
      Needed for https://github.com/tarantool/tarantool-ee/issues/197
      
      NO_DOC=internal
      NO_TEST=ee
      NO_CHANGELOG=internal
      742de9bf
    • Vladimir Davydov's avatar
      sequence: replace assertion with diag in sequence_data_iterator_create · 2ecaf2fc
      Vladimir Davydov authored
      We aren't planning to support all iterator types for _sequence read
      views, but once we implement a Lua API for read views, the user will
      still be able to create a read view of this space. So let's replace
      the assertions with a graceful error.
      
      Needed for https://github.com/tarantool/tarantool-ee/issues/197
      
      NO_DOC=internal
      NO_TEST=ee
      NO_CHANGELOG=internal
      2ecaf2fc
    • Vladimir Davydov's avatar
      memtx: reset read view key_def · 1aa186fa
      Vladimir Davydov authored
      Tuples stored in a read view might not have a format, because we
      overwrite the tuple format id when we free a tuple. So for anything more
      sophisticated than a full-scan, we need to use special comparators that
      don't access the tuple format. To address that, let's provide a way to
      reset tree and hash key_def if ENABLE_READ_VIEW is defined.
      
      The stub functions simply reset the read view key_def to NULL, because
      it isn't supposed to be used in the CE version.
      
      Needed for https://github.com/tarantool/tarantool-ee/issues/197
      
      NO_DOC=internal
      NO_TEST=ee
      NO_CHANGELOG=internal
      1aa186fa
    • Vladimir Davydov's avatar
      memtx: allow to override read view iterator implementation · 4e873f9a
      Vladimir Davydov authored
      For memtx tree and hash indexes: if the ENABLE_READ_VIEW macro is
      defined, include a source file with the read view iterator
      implementation instead of defining it directly. We don't need to support
      any iterator types except ALL in the CE repository, because user read
      views will be available only in EE. All other iterator types will be
      defined in the EE repository. We include source files (not headers),
      because to implement a read view iterator, we need access to index
      internals, which are defined in memtx_hash.cc and memtx_tree.cc.
      
      The included implementation source file is supposed to define
      the {tree,hash}_read_view_iterator_start function, which positions the
      iterator to the given key. It's called directly by create_iteartor index
      read view method.
      
      For the memtx tree index, the iterator implementation needs to know the
      iteration key (for handling EQ/REQ requests) so we also add the key to
      the iterator struct in this commit.
      
      Needed for https://github.com/tarantool/tarantool-ee/issues/197
      
      NO_DOC=internal
      NO_TEST=ee
      NO_CHANGELOG=internal
      4e873f9a
    • Vladimir Davydov's avatar
      memtx: factor out memtx_prepare_read_view_tuple · c03b91c2
      Vladimir Davydov authored
      We can't return tuples retrieved from a consistent index read view as
      is. We need to filter out dirty tuples and decompress compressed tuples.
      Let's introduce a helper function for this. Currently, this helper
      function is used only in the ALL iterator implementation of the tree and
      hash indexes. Later, we will use it in all other iterator types, which
      will be implemented in the EE repository.
      
      Needed for https://github.com/tarantool/tarantool-ee/issues/197
      
      NO_DOC=refactoring
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      c03b91c2
    • Vladimir Davydov's avatar
      index: store copy of index_def in index_read_view · db6535c4
      Vladimir Davydov authored
      To implement all iterator types for memtx tree and hash index read
      views, we need to have the key definition. We can't just use the key
      definition stored in the index directly, because, despite the fact that
      a read view keeps a reference the index, its index definition may still
      be changed by alter (when compatible changes happen).
      
      To solve this problem, let's store a copy of the index definition in
      memtx tree and hash index read views. The index definition also contains
      the index name, which will be useful for exporting the read view to Lua.
      
      Needed for https://github.com/tarantool/tarantool-ee/issues/197
      
      NO_DOC=internal
      NO_TEST=ee
      NO_CHANGELOG=internal
      db6535c4
    • Vladimir Davydov's avatar
      index: add exhausted_iterator_next stub · 00b76cab
      Vladimir Davydov authored
      When an iterator gets exhausted, we often set the iterator callback
      to a stub function that always returns NULL. Let's add a global stub
      function for that so that we can reuse it.
      
      NO_DOC=refactoring
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      00b76cab
  5. Aug 24, 2022
  6. Aug 23, 2022
    • Anna Balaeva's avatar
      ci: improve `report-job-status` action · b07d00a3
      Anna Balaeva authored
      This patch allows to call `report-job-status` action with only one
      input: `bot-token`. VK Teams chat ID has the default value in current
      action, API URL has the default value in [1].
      
      [1] `tarantool/actions/report-job-status`
      
      NO_DOC=ci
      NO_TEST=ci
      NO_CHANGELOG=ci
      b07d00a3
    • Vladimir Davydov's avatar
      memtx: fix tuple garbage collection not resumed after snapshot · 2040e7f6
      Vladimir Davydov authored
      This is a degradation introduced by commit 26f7056f ("Introduce
      internal database read view API"): tuple garbage collection is never
      resumed after a snapshot. This happens, because we don't add engine read
      views to the read view engine list on read view construction. As a
      result, read_view_close() never closes the memtx engine read view.
      
      NO_DOC=bug fix
      NO_CHANGELOG=unreleased
      2040e7f6
    • Gleb Kashkin's avatar
      console: fix multiline commands saved as oneline · d2271ec0
      Gleb Kashkin authored
      When multiline commands were loaded from .tarantool_history, they were
      treated as a bunch of oneline commands. Now readline is configured to
      write timestamps in .tarantool_history as delimiters and multiline
      commands are handled correctly.
      
      If there is already a .tarantool_history file, readline will set
      timestamps automatically, nothing will be lost.
      
      Closes #7320
      NO_DOC=bugfix
      NO_TEST=impossible to check readline history from lua
      d2271ec0
Loading