Skip to content
Snippets Groups Projects
  1. May 20, 2022
    • Timur Safin's avatar
      datetime: implement date.isdst · 063cfdcd
      Timur Safin authored
      Properly calculate `isdst` field in datetime Lua object and
      for attribute returned by `:totable()` function.
      
      NO_DOC=next commit
      
      (cherry picked from commit aec6fbac)
      063cfdcd
    • Timur Safin's avatar
      datetime: use Olson for timezone name · 0b0f2cd1
      Timur Safin authored
      * Modified localtime.c to use tnt_tm instead of tm structure;
      * Use this structure for passing data to tnt_localtime_rz at
        the moment of time-zone resolution;
      * As a side-effect of refactoring - simplified singleton we
        used to use for automagical sorting of array with timezone
        abbreviations
      
      NO_DOC=internal
      NO_CHANGELOG=internal
      
      (cherry picked from commit 2116bbfd)
      0b0f2cd1
    • Timur Safin's avatar
      datetime: localtime.c switched to Tarantool struct tnt_tm · e14ceb32
      Timur Safin authored
      Using our own `tnt_tm` allows to properly pass `tm_tzindex`.
      
      NO_DOC=refactoring
      NO_CHANGELOG=refactoring
      NO_TEST=refactoring
      
      (cherry picked from commit 08400823)
      e14ceb32
    • Timur Safin's avatar
      datetime: primary and aliases zones in Olson · 71ebc1b0
      Timur Safin authored
      * localtime.c refactored to make tzalloc/tzfree public;
      * Modified Perl script to generate primary Olson timezones and aliases.
        Get rid of NYI;
      
      NO_DOC=refactoring
      NO_CHANGELOG=refactoring
      NO_TEST=refactoring
      
      (cherry picked from commit b6ff1978)
      71ebc1b0
    • Timur Safin's avatar
      datetime, build - tzcode/olson integrated into cmake · 83fe3c97
      Timur Safin authored
      - localtime.c, tzfile.h added to build
      
      NO_DOC=build
      NO_CHANGELOG=build
      NO_TEST=build
      
      (cherry picked from commit d3acfece)
      83fe3c97
    • Vladimir Davydov's avatar
      applier: make SSLError retryable · 238be74a
      Vladimir Davydov authored
      A certificate used for an encrypted replication connection may expire,
      in which case the user will be forced to reconfigure the connection both
      on the master and on the replica to use the new certificate. If the
      replica completes the reconfiguration first, it will fail to connect to
      the master and never retry, even though the master should complete its
      reconfiguration in a moment.
      
      To avoid that, we should make the applier retry to connect on SSLError,
      just like it does on SocketError.
      
      Needed for https://github.com/tarantool/tarantool-ee/issues/107
      
      NO_DOC=ee
      NO_TEST=ee
      NO_CHANGELOG=ee
      
      (cherry picked from commit a1183d6e)
      238be74a
    • Vladimir Davydov's avatar
      box: add error code for SSLError · 1806f816
      Vladimir Davydov authored
      Applier uses box_error_code() to for better logging:
       - It remembers tha last raised error code and skips logging if the new
         error code is the same.
       - It logs "will retry every X seconds" only for retryable error codes
         (for example, ER_SYSTEM) while for non-retryable errors (for example,
         ER_PROC_LUA) the message isn't logged.
      
      box_error_code() returns ER_PROC_LUA for SSLError, which is confusing
      and would result in inconsistent logging in applier if we made SSLError
      retryable. Let's add a separate error code for this error (ER_SSL) and
      introduce a test case that checks that box_error_code() works as
      expected for all kinds of errors.
      
      Follow-up commit a7028dde ("Add SSL iostream stub").
      Needed for https://github.com/tarantool/tarantool-ee/issues/107
      
      NO_DOC=internal
      NO_CHANGELOG=internal
      
      (cherry picked from commit b85cf605)
      1806f816
    • Maxim Kokryashkin's avatar
      luajit: bump submodule · 3ff2aec1
      Maxim Kokryashkin authored
      LuaJIT submodule is bumped to introduce the following changes:
      * sysprof: change C configuration API
      * sysprof: enrich symtab on a new trace or a proto
      * sysprof: fix SYSPROF_HANDLER_STACK_DEPTH
      * sysprof: make internal API functions static
      * sysprof: add LUAJIT_DISABLE_SYSPROF to Makefile
      * symtab: check the _GNU_SOURCE definition
      
      Within this changeset Tarantool-specific backtrace handler is introduced
      and set to be used by sysprof machinery.
      
      Besides, all new public Lua C API introduced within this changeset is
      added to extra/exports.
      
      Follows up #781
      
      NO_DOC=LuaJIT submodule bump
      NO_TEST=LuaJIT submodule bump
      NO_CHANGELOG=LuaJIT submodule bump
      
      (cherry picked from commit f40ad50d)
      Unverified
      3ff2aec1
    • Mergen Imeev's avatar
      sql: introduce operator [] · cff513d1
      Mergen Imeev authored
      This patch introduces operator [] that allows to get elements from MAP
      and ARRAY values.
      
      Closes #4762
      Closes #4763
      Part of #6251
      
      @TarantoolBot document
      Title: Operator [] in SQL
      
      Operator `[]` allows to get an element of MAP and ARRAY values.
      Examples:
      ```
      tarantool> box.execute([[SELECT [1, 2, 3, 4, 5][3];]])
      ---
      - metadata:
        - name: COLUMN_1
          type: any
        rows:
        - [3]
      ...
      
      tarantool> box.execute([[SELECT {'a' : 123, 7: 'asd'}['a'];]])
      ---
      - metadata:
        - name: COLUMN_1
          type: any
        rows:
        - [123]
      ...
      ```
      
      The returned values is of type ANY.
      
      If the operator is applied to a value that is not a MAP or ARRAY or is
      NULL, an error is thrown.
      
      Example:
      ```
      tarantool> box.execute([[SELECT 1[1];]])
      ---
      - null
      - Selecting is only possible from map and array values
      ...
      ```
      
      However, if there are two or more operators next to each other, the
      second or following operators do not throw an error, but instead
      return NULL.
      
      Example:
      ```
      tarantool> box.execute([[select [1][1][2][3][4];]])
      ---
      - metadata:
        - name: COLUMN_1
          type: any
        rows:
        - [null]
      ...
      ```
      
      (cherry picked from commit 814befe8)
      cff513d1
  2. May 19, 2022
  3. May 18, 2022
    • Mergen Imeev's avatar
      sql: fix type calculation for DATETIME arithmetic · c36986b6
      Mergen Imeev authored
      After this correction DATETIME arithmetic result type will be
      calculated correctly. Before this fix the type returned in the metadata
      was "scalar".
      
      Follow-up #6773
      
      NO_DOC=Bugfix
      NO_CHANGELOG=Bugfix
      c36986b6
    • Mergen Imeev's avatar
      sql: introduce cast from MAP to INTERVAL · ac06e04e
      Mergen Imeev authored
      This patch introduces explicit cast from MAP to INTERVAL.
      
      Follow-up #6773
      
      NO_DOC=INTERVAL has already been introduced.
      NO_CHANGELOG=INTERVAL has already been introduced.
      ac06e04e
    • Mergen Imeev's avatar
      sql: introduce cast from MAP to DATETIME · 086bcfd2
      Mergen Imeev authored
      This patch introduces explicit cast from MAP to DATETIME.
      
      Follow-up #6773
      
      NO_DOC=DATETIME has already been introduced.
      NO_CHANGELOG=DATETIME has already been introduced.
      086bcfd2
    • Mergen Imeev's avatar
      sql: introduce cast from STRING to DATETIME · 48dfe7b3
      Mergen Imeev authored
      This patch introduces explicit cast from STRING to DATETIME.
      
      Follow-up #6773
      
      NO_DOC=DATETIME has already been introduced.
      NO_CHANGELOG=DATETIME has already been introduced.
      48dfe7b3
    • Serge Petrenko's avatar
      replication: fix race in accessing vclock by applier and tx threads · a3ea6fe5
      Serge Petrenko authored
      When applier ack writer was moved to applier thread, it was overlooked
      that it would start sharing replicaset.vclock between two threads.
      
      This could lead to the following replication errors on master:
      
       relay//102/main:reader V> Got a corrupted row:
       relay//102/main:reader V> 00000000: 81 00 00 81 26 81 01 09 02 01
      
      Such a row has an incorrectly-encoded vclock: `81 01 09 02 01`.
      When writer fiber encoded the vclock length (`81`), there was only one
      vclock component: {1: 9}, but at the moment of iterating over the
      components, another WAL write was reported to TX thread, which bumped
      the second vclock component {1: 9, 2: 1}.
      
      Let's fix the race by delivering a copy of current replicaset vclock to
      the applier thread.
      
      Also add a perf test to the perf/ directory.
      
      Closes #7089
      Part-of tarantool/tarantool-qa#166
      
      NO_DOC=internal fix
      NO_TEST=hard to test
      
      (cherry picked from commit ddec704e)
      a3ea6fe5
  4. May 17, 2022
    • Vladimir Davydov's avatar
      alter: don't swap tuple dictionaries for online space upgrade · c8112326
      Vladimir Davydov authored
      We don't rebuild the tuples stored in the space when a space format is
      updated, just check that they are compatible with the new format. For
      the old tuple fields to be accessible by the new format field names, we
      point the old format dictionary to the new format dictionary (a field
      dictionary is a reference counted object so the same dictionary can be
      used by multiple formats).
      
      This isn't necessary for online space upgrade, because in this case
      we upgrade each tuple stored in the space to the new format before
      returning it to the user. Moreover, using the new dictionary for the old
      tuples would even be harmful in this case, because the old tuples may be
      incompatible with the new format, while the space upgrae function may
      use the old field names.
      
      Needed for https://github.com/tarantool/tarantool-ee/issues/112
      
      NO_DOC=ee
      NO_TEST=ee
      NO_CHANGELOG=ee
      
      (cherry picked from commit 73733e51)
      c8112326
    • Yaroslav Lobankov's avatar
      ci: add Ubuntu Groovy (20.10) workflow again · b77e0abc
      Yaroslav Lobankov authored
      Add the ubuntu_20_10.yml and ubuntu_20_10_aarch64.yml workflow files to
      build Tarantool packages for x86_64 and aarch64 systems.
      
      Actually, it was already added in 980d7676 (2.9.0-100-g980d7676b) in the
      scope of #5824 and removed then in 19a161b5 (2.10.0-beta2-4-g19a161b5f)
      and dc19be40 (2.10.0-beta2-5-gdc19be406).
      
      But, eventually, it was decided to add this workflow again to release
      Tarantool packages for Ubuntu Groovy as well.
      
      Follows-up tarantool/tarantool#5824
      
      NO_DOC=ci
      NO_TEST=ci
      NO_CHANGELOG=ci
      
      (cherry picked from commit 47fbd24a)
      Unverified
      b77e0abc
    • Yaroslav Lobankov's avatar
      ci: add Ubuntu Hirsute/Impish aarch64 workflows · 77de011b
      Yaroslav Lobankov authored
      Add the ubuntu_21_04_aarch64.yml and ubuntu_21_10_aarch64.yml workflow
      files to build Tarantool packages for the aarch64 system.
      
      Follows-up tarantool/tarantool#5825
      Follows-up tarantool/tarantool#6566
      
      NO_DOC=ci
      NO_TEST=ci
      NO_CHANGELOG=ci
      
      (cherry picked from commit 74f67c7b)
      Unverified
      77de011b
    • artembo's avatar
      ci: add Ubuntu Jammy (22.04) workflow · 2bbcb60b
      artembo authored
      
      Add the ubuntu_22_04.yml and ubuntu_22_04_aarch64.yml workflow files to
      build Tarantool packages for x86_64 and aarch64 systems.
      
      Closes tarantool/tarantool-qa#237
      
      NO_DOC=ci
      NO_TEST=ci
      NO_CHANGELOG=ci
      
      Co-authored-by: default avatarYaroslav Lobankov <y.lobankov@tarantool.org>
      (cherry picked from commit abd9bbf0)
      Unverified
      2bbcb60b
    • Vladimir Davydov's avatar
      iproto: log error before iproto_write_error · 2049b9f3
      Vladimir Davydov authored
      iproto_write_error() may reset diag (for example, if the client closes
      the socket), thus invalidating the error we are going to log and leading
      to a use after free bug. We must log the error before trying to send it
      to the client.
      
      The bug was introduced by commit 9b4ab9fe ("iproto: use iostream
      abstraction"), which switched iproto_write_error() from plain write() to
      the iostream_write(), which may set diag.
      
      Closes #6890
      
      NO_DOC=bug fix
      NO_CHANGELOG=unreleased
      
      (cherry picked from commit 73117059)
      2049b9f3
  5. May 16, 2022
    • Pavel Balaev's avatar
      readme: fix repository url · fd5da0f5
      Pavel Balaev authored
      The unauthenticated git protocol on port 9418 is no longer supported.
      
      NO_DOC=doc
      NO_TEST=doc
      NO_CHANGELOG=doc
      
      (cherry picked from commit 12cf9980)
      fd5da0f5
    • Georgiy Lebedev's avatar
      box: improve check for dangerous `select` calls · a76c709a
      Georgiy Lebedev authored
      Consider the following case a safe `select` call (i.e., do not issue a
      warning):
      * offset + limit <= 1000 (default value of offset is 0, default value of
      limit is 4294967295);
      
      Add new dangerous `select` call case:
      * 'ALL', 'GE', 'GT', 'LE', 'LT' iterator even with key present.
      
      Because of the additional logic, it was decided to refactor
      `check_select_args` and call it after resolving options in
      `check_select_opts`.
      
      Closes #7129
      
      @TarantoolBot document
      Title: improve check for dangerous `select` calls
      
      Calls with `offset + limit <= 100`
      are now considered safe (i.e., a warning is not issued), e.g.:
      box.space.s:select(nil, {offset = 1000})
      box.space.s:select(nil, {limit = 1000})
      box.space.s:select(nil, {offset = 500, limit = 500})
      
      'ALL', 'GE', 'GT', 'LE', 'LT' iterators are now considered dangerous by
      default even with key present, e.g.:
      box.space.s:select({0})
      box.space.s:select({0}, {iterator = 'GE'})
      
      But not that these calls are still safe:
      box.space.s:select({0}, {limit = 1000})
      box.space.s:select({0}, {limit = 1000, iterator = 'GE'})
      box.space.s:select({0}, {iterator = 'EQ'})
      
      (cherry picked from commit 29654ffe)
      a76c709a
    • Timur Safin's avatar
      datetime: make date.new{} and date:set{} equivalent · 6e7a3591
      Timur Safin authored
      Constructor date.new() and modifier date:set() should always produce same
      result for all attributes combinations. Fixed the problem for
      `timestamp` with `tzoffset`.
      
      Fixes #6793
      
      @TarantoolBot document
      Title: datetime :set{} with tzoffset
      
      Constructor `date.new()` and modifier `date:set()` should always produce
      same result for all attributes combinations. Fixed the problem for
      `timestamp` with `tzoffset`.
      
      ```
      tarantool> date.new{tzoffset = '+0800', timestamp = 1630359071}
      ---
      - 2021-08-30T21:31:11+0800
      ...
      
      tarantool> date.new():set{tzoffset = '+0800', timestamp = 1630359071}
      ---
      - 2021-08-30T21:31:11+0800
      ...
      ```
      
      (cherry picked from commit d56840d7)
      6e7a3591
  6. May 12, 2022
    • Mergen Imeev's avatar
      sql: introduce syntax for MAP values · bc8bc1ad
      Mergen Imeev authored
      This patch introduces a new syntax that allows to create MAP values in
      an SQL query.
      
      Part of #4763
      
      @TarantoolBot document
      Title: Syntax for MAP in SQL
      
      The syntax for creating document values is now available in SQL. You can
      use `{`, `:` and `}` to create a MAP value. Only INTEGER, STRING, and
      UUID values can be keys in a MAP value. If there are two or more values
      for the same key, the last one will be used for that key.
      
      Examples:
      ```
      tarantool> box.execute("SELECT {1 : 'a', 'asd' : 1.5, uuid() : true};")
      ---
      - metadata:
        - name: COLUMN_1
          type: map
        rows:
        - [{1: 'a', 91ca4dbb-c6d4-4468-b4a4-ab1e409dd87e: true, 'asd': 1.5}]
      ...
      ```
      
      ```
      tarantool> box.execute("SELECT {'h' : ['abc', 321], 7 : {'b' : 1.5}};")
      ---
      - metadata:
        - name: COLUMN_1
          type: map
        rows:
        - [{7: {'b': 1.5}, 'h': ['abc', 321]}]
      ...
      ```
      
      (cherry picked from commit 7175f1c8)
      bc8bc1ad
    • Mergen Imeev's avatar
      sql: properly check bind variable names · 78befdf9
      Mergen Imeev authored
      After this patch, variable names will have to follow the rules defined
      for identifiers in SQL. Essentially, this means that a digit can no
      longer be used as the first character of a bind variable name.
      
      Part of #4763
      
      NO_DOC=Will be added later.
      NO_CHANGELOG=Will be added later.
      
      (cherry picked from commit 899fbaeb)
      78befdf9
    • Yaroslav Lobankov's avatar
      ci: fix email subject in perf_sysbench.yml · 1de6d49e
      Yaroslav Lobankov authored
      The `${{ github.ref_name }}` expression is always evaluated to 'master'
      because the workflow is running on the 'master' branch. But it is wrong
      in the case of the '2.10' branch. Now it's fixed.
      
      NO_DOC=ci
      NO_TEST=ci
      NO_CHANGELOG=ci
      
      (cherry picked from commit b08e23f4)
      Unverified
      1de6d49e
  7. May 11, 2022
    • Yaroslav Lobankov's avatar
      ci: run sysbench against 2.10 branch · 1acfc2fd
      Yaroslav Lobankov authored
      The '2.8' branch is no longer supported. So let's switch to '2.10'.
      
      NO_DOC=ci
      NO_TEST=ci
      NO_CHANGELOG=ci
      
      (cherry picked from commit b212ceeb)
      Unverified
      1acfc2fd
    • Yaroslav Lobankov's avatar
      ci: add facility to run sysbench WF in debug mode · 80726e06
      Yaroslav Lobankov authored
      The perf_sysbench.yml workflow has the 'workflow_dispatch' trigger
      that is often used to test some workflow changes. To not litter in
      the InfluxDB prod bucket, MyTeam chat and mailing list, the special
      option is added (Debug mode). When checking this option the InfluxDB
      test bucket, MyTeam chat, and mailing list will be used.
      
      NO_DOC=ci
      NO_TEST=ci
      NO_CHANGELOG=ci
      
      (cherry picked from commit e77ecdd4)
      Unverified
      80726e06
    • Yaroslav Lobankov's avatar
      ci: add performance test reporting for sysbench · 63925f1f
      Yaroslav Lobankov authored
      Since analyzing the performance test results via the workflow artifacts
      is quite inconvenient (we need to download the artifact, unpack it, look
      through results), we need a more human approach to see the test report.
      Moreover, it would be cool to see the performance difference between the
      commits.
      
      So this patch adds reporting the performance test results to MyTeam chat
      and mailing list. Furthermore, the comparison of test results is added
      to the report. Seeing the test report in the chat or mail is very simple
      and convenient, plus forever results history as a bonus.
      
      The test report looks something like this:
      
          # Curr:
          #   branch:  add-feature-y
          #   build:   1.2.3-42-g6c71c3901
          #   summary: Add feature Y
          #   machine: x86_64
          #   distrib: ce
          #   gc64:    false
          # Prev:
          #   branch:  add-feature-x
          #   build:   1.2.3-41-g5271240ea
          #   summary: Add feature X
          #   machine: x86_64
          #   distrib: ce
          #   gc64:    false
          +----------------------+----------+----------+----------+
          |Sysbench              | Curr(rps)| Prev(rps)|     Ratio|
          +----------------------+----------+----------+----------+
          |oltp_delete           | 11408.000| 11532.000|     0.989|
          |oltp_insert           | 31455.000| 31322.000|     1.004|
          |oltp_point_select     | 65031.000| 66486.000|     0.978|
          |oltp_read_only        |  1732.000|  1735.000|     0.998|
          |oltp_read_write       |  1211.000|  1196.000|     1.013|
          |oltp_update_index     | 15580.000| 15570.000|     1.001|
          |oltp_update_non_index | 16129.000| 16093.000|     1.002|
          |oltp_write_only       |  4482.000|  4434.000|     1.011|
          |select_random_points  | 18525.000| 18517.000|     1.000|
          |select_random_ranges  |  4364.000|  4331.000|     1.008|
          +----------------------+----------+----------+----------+
          |gmean                 |  9223.593|  9220.182|     1.000|
          +----------------------+----------+----------+----------+
      
      NO_DOC=ci
      NO_TEST=ci
      NO_CHANGELOG=ci
      
      (cherry picked from commit e2803cb1)
      Unverified
      63925f1f
    • Timur Safin's avatar
      datetime: handle timezone names in tz · 69b27a7c
      Timur Safin authored
      Since recently we partially support timezone names (i.e. as
      abbreviations) so we may modify tz attribute support for
      datetime constructors or :set() operations.
      
      Closes #7076
      Relates to #7007
      
      @TarantoolBot document
      Title: datetime tz attribute
      
      Now `tz` attribute is properly handled in datetime value
      constructors or `:set{}` method modifiers.
      
      ```
      tarantool> T = date.new{year = 1980, tz = 'MSK'}
      ---
      ...
      
      tarantool> T.tzoffset
      ---
      - 180
      ...
      
      tarantool> T.tz
      ---
      - MSK
      ...
      tarantool> T = date.new{year = 1980, tzoffset = 180}
      ---
      ...
      
      tarantool> T.tzindex
      ---
      - 0
      ...
      
      tarantool> T.tz
      ---
      -
      ...
      
      tarantool> T.tzoffset
      ---
      - 180
      ...
      
      tarantool> T:set{tz = 'MSK'}
      ---
      ...
      
      tarantool> T.tz
      ---
      - MSK
      ...
      
      ```
      
      (cherry picked from commit 7036b55a)
      69b27a7c
  8. May 06, 2022
    • Yaroslav Lobankov's avatar
      cleanup: delete old unused files · 22af06a6
      Yaroslav Lobankov authored
      It looks like we have some files in the source tree that are not used
      anymore. So there is no sense to keep them.
      Files to be deleted: .appveyor.yml, Jenkinsfile, snapcraft.yaml.
      
      NO_DOC=files removal
      NO_TEST=files removal
      NO_CHANGELOG=files removal
      
      (cherry picked from commit eaf96984)
      Unverified
      22af06a6
    • Vladimir Davydov's avatar
      test: fix luatest server cleanup · 32250ed3
      Vladimir Davydov authored
      It doesn't work, because fio.rmtree doesn't accept wildcards.
      Let's delete the whole server working tree on cleanup.
      
      NO_DOC=test
      NO_CHANGELOG=test
      
      (cherry picked from commit 00d6dfcd)
      32250ed3
    • Vladimir Davydov's avatar
      fiber_cond: add static initializer · f576a182
      Vladimir Davydov authored
      Similar to RLIST_HEAD_INITIALIZER and RLIST_HEAD. Needed to initialize
      a global fiber_cond variable without calling fiber_cond_create.
      
      NO_DOC=internal
      NO_TEST=internal
      NO_CHANGELOG=internal
      
      (cherry picked from commit 0016e80a)
      f576a182
Loading