Skip to content
Snippets Groups Projects
  1. Nov 07, 2022
    • Georgiy Lebedev's avatar
      build: revert usage of relative paths in debugging information · e16e22dd
      Georgiy Lebedev authored
      The `-Wa,--debug-prefix-map` compiler flag breaks GNU-based LTO, and also
      we cannot reliably test this feature.
      
      Follow-up 256da010
      
      NO_CHANGELOG=bugfix
      NO_DOC=bugfix
      NO_TEST=bugfix
      
      (cherry picked from commit 41c7db41)
      e16e22dd
    • Mergen Imeev's avatar
      box: rework index_def_is_valid() · 056e26a1
      Mergen Imeev authored
      This patch renames index_def_is_valid() to index_def_check() and makes
      it return 0 or -1 because that function sets a diag.
      
      NO_DOC=refactoring
      NO_TEST=refactoring
      NO_CHANGELOG=refactoring
      
      (cherry picked from commit 5df76ade)
      056e26a1
    • Mergen Imeev's avatar
      sql: throw error on creation of too many indexes · 30ae8b1a
      Mergen Imeev authored
      Prior to this patch, there was no error of creating too many indexes in
      SQL. This led to a situation where indexes with IDs greater than
      BOX_INDEX_MAX were not created, but no error was thrown. For example, in
      the case of CREATE TABLE, only indexes with an ID less than
      BOX_INDEX_MAX were created. Now an error is thrown when creating too
      many indexes.
      
      Closes #5526
      
      NO_DOC=bugfix
      
      (cherry picked from commit 2705e227)
      30ae8b1a
    • Mergen Imeev's avatar
      sql: reset autoincrement IDs before execution · 199c59ea
      Mergen Imeev authored
      After this patch, the list of auto-increment IDs will be reset before
      executing the prepared statement.
      
      Closes #6422
      
      NO_DOC=bugfix
      
      (cherry picked from commit 5eefa06f)
      199c59ea
    • Mergen Imeev's avatar
      sql: fix error with new field in new index · 4ce0b6a6
      Mergen Imeev authored
      In case the space format is changed after inserting tuples, the new
      format contains new fields, and a new index is created that works with
      those new fields, it is possible to get an assertion during SELECT. This
      problem was fixed in this path.
      
      Closes #5183
      
      NO_DOC=bugfix
      
      (cherry picked from commit 440a0f8c)
      4ce0b6a6
    • Sergey Ostanevich's avatar
      test: fix flakiness of replication/qsync_basic · c69537ab
      Sergey Ostanevich authored
      The async transactions should always wait for LSN from the master after
      switch to replica.
      
      Closes tarantool/tarantool-qa#274
      
      NO_CHANGELOG=testing
      NO_DOC=testing
      
      (cherry picked from commit 0fbdfd0f)
      c69537ab
  2. Nov 03, 2022
  3. Nov 02, 2022
  4. Nov 01, 2022
    • Nikolay Shirokovskiy's avatar
      test: turn LuaJIT off in tests with dlsym · 18188ff8
      Nikolay Shirokovskiy authored
      `dlsym` is known to be buggy in FreeBSD. See #7640.
      
      NO_DOC=internal
      NO_CHANGELOG=internal
      
      (cherry picked from commit 67e79b15)
      18188ff8
    • Sergey Ostanevich's avatar
      test: replication/transaction flakiness fix · efc95ee4
      Sergey Ostanevich authored
      The test is expected the replication is broken by the time of the
      server switch. Apparently, switch won the race, so the expectation
      is changed for waiting.
      
      Closes https://github.com/tarantool/tarantool-qa/issues/271
      
      NO_CHANGELOG=testing
      NO_DOC=testing
      NO_TEST=testing
      
      (cherry picked from commit 0e181b35)
      Unverified
      efc95ee4
    • Ilya Verbin's avatar
      box: fix fkey creation together with new field names · a0de2404
      Ilya Verbin authored
      If a complex (tuple) foreign key is added along with a new field name
      that participates in that foreign key, the foreign key does not work
      correctly. This happens because the new name of a local field is added
      to new_space->def->dict only in ModifySpace::alter, while before that,
      new_space->def->dict points to the old dictionary with old names (see
      ModifySpace::alter_def). So when local_field_no is initialized earlier
      in alter_space_do -> space_create -> tuple_constraint_fkey_init, it's
      unable to find the new field number in the old dictionary.
      
      Fix this by moving `new_def->dict = alter->old_space->def->dict;` from
      ModifySpace::alter_def() to ModifySpace::alter(). Note that, as before,
      we refer to the old dictionary from the new space (just put new names
      into it), because that dict is referenced by existing tuple formats.
      
      Closes #7652
      
      NO_DOC=bugfix
      
      (cherry picked from commit 4aaf9049)
      a0de2404
  5. Oct 31, 2022
    • Nikolay Shirokovskiy's avatar
      app: fix crash on logrotate and immediate exit · 99de5b74
      Nikolay Shirokovskiy authored
      `say_logrotate` does not rotate logs synchronously. It posts tasks to
      coio which executes them in it's pool thread. On application exit we
      destroy logs calling `log_destroy`. This function waits for rotate task
      to finish because if it will free resources immediately then unfinished
      rotate task can have use-after-free issues. Waiting crashes because at
      this moment event loop is not running which is required for
      `fiber_cond_wait` to work.
      
      Note that if there is no crash then we will hang forever waiting in
      `log_destroy` because event loop is not running and
      `log_rotate_async_cb` will never be executed.
      
      Let's use mutexes and conditions instead. It solves both problems with
      crash and hang. Thanks Vladimir Davydov for idea.
      
      Fixes #4450
      
      NO_DOC=bugfix
      
      (cherry picked from commit eed09192)
      99de5b74
    • Yaroslav Lobankov's avatar
      ci: add recursive checkout to jepsen workflows · 49a0dae2
      Yaroslav Lobankov authored
      Fixes tarantool/tarantool-qa#282
      
      NO_DOC=ci
      NO_TEST=ci
      NO_CHANGELOG=ci
      
      (cherry picked from commit 16585472)
      Unverified
      49a0dae2
    • Nick Volynkin's avatar
      ci: recursive checkout in coverity action · 7317c970
      Nick Volynkin authored
      Fixes tarantool/tarantool-qa#281
      
      NO_DOC=ci
      NO_TEST=ci
      NO_CHANGELOG=ci
      
      (cherry picked from commit 3c0b800a)
      Unverified
      7317c970
  6. Oct 28, 2022
  7. Oct 26, 2022
    • Vladimir Davydov's avatar
      msgpack: fix crash on decode of 0xc1 · e48a8f4b
      Vladimir Davydov authored
      0xc1 isn't a valid MsgPack header, but it was allowed by mp_check.
      As a result, msgpack.decode crashed while trying to decode it.
      This commit updates the msgpuck library to fix this issue.
      
      Closes #7818
      
      NO_DOC=bug fix
      
      (cherry picked from commit ced405af)
      e48a8f4b
  8. Oct 25, 2022
    • Serge Petrenko's avatar
      security: make os.getenv safe · ec3eb525
      Serge Petrenko authored
      Closes #7797
      
      NO_DOC=security fix
      NO_TEST=security fix
      
      (cherry picked from commit dd7d46af)
      ec3eb525
    • Serge Petrenko's avatar
      security: check size boundaries for getenv() returns · 829b65f8
      Serge Petrenko authored
      getenv() return values cannot be trusted, because an attacker might set
      them. For instance, we shouldn't expect, that getenv() returns a value
      of some sane size.
      
      Another problem is that getenv() returns a pointer to one of
      `char **environ` members, which might change upon next setenv().
      
      Introduce a wrapper, getenv_safe(), which returns the value only when
      it fits in a buffer of a specified size, and copies the value onto the
      buffer. Use this wrapper everywhere in our code.
      
      Below's a slightly decorated output of `grep -rwn getenv ./src --include
      *.c --include *.h --include *.cc --include *.cpp --include *.hpp
      --exclude *.lua.c` as of 2022-10-14.
      `-` marks invalid occurences (comments, for example),
      `*` marks the places that are already guarded before this patch,
      `X` mars the places guarded in this patch, and
      `^` marks places fixed in the next commit:
      
      NO_WRAP
      ```
      * ./src/lib/core/coio_file.c:509:	const char *tmpdir = getenv("TMPDIR");
      X ./src/lib/core/errinj.c:75: const char *env_value = getenv(inj->name);
      - ./src/proc_title.c:202: * that might try to hang onto a getenv() result.)
      - ./src/proc_title.c:241:	* is mandatory to flush internal libc caches on getenv/setenv
      X ./src/systemd.c:54: sd_unix_path = getenv("NOTIFY_SOCKET");
      * ./src/box/module_cache.c:300: const char *tmpdir = getenv("TMPDIR");
      X ./src/box/sql/os_unix.c:1441: azDirs[0] = getenv("SQL_TMPDIR");
      X ./src/box/sql/os_unix.c:1446: azDirs[1] = getenv("TMPDIR");
      * ./src/box/lua/console.c:394: const char *envvar = getenv("TT_CONSOLE_HIDE_SHOW_PROMPT");
      ^ ./src/box/lua/console.lua:771: local home_dir = os.getenv('HOME')
      ^ ./src/box/lua/load_cfg.lua:1007: local raw_value = os.getenv(env_var_name)
      X ./src/lua/init.c:575: const char *path = getenv(envname);
      X ./src/lua/init.c:592: const char *home = getenv("HOME");
      * ./src/find_path.c:77: snprintf(buf, sizeof(buf) - 1, "%s", getenv("_"));
      ```
      NO_WRAP
      
      Part-of #7797
      
      NO_DOC=security
      
      (cherry picked from commit b86395ff)
      829b65f8
    • Mergen Imeev's avatar
      sql: fix another cursor invalidation · 1b357d93
      Mergen Imeev authored
      This patch fixes the issue described in issue #5310 when the tuple
      format has more fields than the space format. This solution is more
      general than the solution in 89057a21.
      
      Follow-up #5310
      Closes #4666
      
      NO_DOC=bugfix
      
      (cherry picked from commit 5a38c5c9)
      1b357d93
  9. Oct 21, 2022
    • Georgiy Lebedev's avatar
      build: use relative paths in diagnostics and debugging information · ac645aa4
      Georgiy Lebedev authored
      Since our diagnostics use the `__FILE__` macro, they provide absolute
      paths, which is kind of redundant and inconsistent: replace them with
      relative ones.
      
      As for debugging information, replacing absolute paths with relative ones
      also requires an extra command to tell the debugger where to find the
      source files, which is not convenient for developers: provide a new
      `DEV_BUILD` option (turned off by default), which replaces absolute paths
      with relative ones in debugging information if turned off.
      
      Strip the prefix map flags from compiler flags exported to tarantool via
      `src/trvia/config.h`.
      
      Closes #7808
      
      NO_DOC=<verbosity>
      NO_TEST=<verbosity>
      
      (cherry picked from commit 256da010)
      ac645aa4
    • Georgiy Lebedev's avatar
      test-run: bump new version · bfa153bb
      Georgiy Lebedev authored
      Fixes bug with determination of debug build (tarantool/test-run#352).
      
      NO_CHANGELOG=<internal submodule version update>
      NO_TEST=<submodule version update>
      NO_DOC=<submodule version update>
      
      (cherry picked from commit e554e481)
      bfa153bb
    • Georgiy Lebedev's avatar
      build: refactor setting hardening compiler flags · 0b47b16e
      Georgiy Lebedev authored
      Setting hardening compiler flags is used in three places: default build,
      static build and enterprise build — refactor it into a separate module.
      
      Follow-up e6abe1c9
      
      NO_CHANGELOG=refactoring
      NO_DOC=refactoring
      NO_TEST=refactoring
      
      (cherry picked from commit dd51a2fa)
      0b47b16e
    • Georgiy Lebedev's avatar
      build: refactor passing compiler flags to dependencies · 2a61c0a7
      Georgiy Lebedev authored
      e6abe1c9 passes compiler flags to dependencies via a `<project>_build` macro
      parameter, which is, firstly, inconvenient, and, secondly, as a result, not
      all dependencies got the required compiler flags passed: use global
      variables instead and pass these flags to skipped dependencies.
      
      Follow-up e6abe1c9
      
      NO_CHANGELOG=refactoring
      NO_DOC=refactoring
      NO_TEST=refactoring
      
      (cherry picked from commit c6794757)
      2a61c0a7
    • Georgiy Lebedev's avatar
      build: fix unsetting of variables in `add_compile_flags` macro · d5e9d14c
      Georgiy Lebedev authored
      `add_compile_flags` macro relied on undefined behaviour: instead of
      unsetting the `_lang` and `_flag` variables, it tried to unset their
      values — fix this.
      
      NO_CHANGELOG=build
      NO_DOC=build
      NO_TEST=build
      
      (cherry picked from commit 4aa9f154)
      d5e9d14c
  10. Oct 20, 2022
  11. Oct 19, 2022
    • Mergen Imeev's avatar
      box: fix format of _vfunc · ee06f892
      Mergen Imeev authored
      The _vfunc system space is the sysview for the _func system space.
      However, the _vfunc format is different from the _func format. This
      patch makes the _vfunc format the same as the _func format.
      
      Closes #7822
      
      NO_DOC=bugfix
      
      (cherry picked from commit 707da125)
      ee06f892
  12. Oct 18, 2022
    • Timur Safin's avatar
      datetime: datetimes subtractions ignored timezone · 8aa13474
      Timur Safin authored
      We used to ignore timezone difference (in `tzoffset`) for
      datetime subtraction operation:
      
      ```
      tarantool> datetime.new{tz='MSK'} - datetime.new{tz='UTC'}
      ---
      - +0 seconds
      ...
      
      tarantool> datetime.new{tz='MSK'}.timestamp -
                 datetime.new{tz='UTC'}.timestamp
      ---
      - -10800
      ...
      ```
      
      Now we accumulate tzoffset difference in the minute component
      of a resultant interval:
      
      ```
      tarantool> datetime.new{tz='MSK'} - datetime.new{tz='UTC'}
      ---
      - -180 minutes
      ...
      ```
      
      Closes #7698
      
      NO_DOC=bugfix
      
      (cherry picked from commit 0daed8d5)
      Unverified
      8aa13474
    • Timur Safin's avatar
      datetime: fix interval arithmetic for DST · 9f8b05ab
      Timur Safin authored
      We did not take into consideration the fact that
      as result of date/time arithmetic we could get
      in a different timezone, if DST boundary has been
      crossed during operation.
      
      ```
      tarantool> datetime.new{year=2008, month=1, day=1,
      			tz='Europe/Moscow'} +
      	   datetime.interval.new{month=6}
      ---
      - 2008-07-01T01:00:00 Europe/Moscow
      ...
      ```
      
      Now we resolve tzoffset at the end of operation if
      tzindex is not 0.
      
      Fixes #7700
      
      NO_DOC=bugfix
      
      (cherry picked from commit 6ca07285)
      Unverified
      9f8b05ab
Loading