Skip to content
Snippets Groups Projects
  1. Jan 25, 2022
    • Vladislav Shpilevoy's avatar
      raft: fix ev_timer.at incorrect usage · e51c61ae
      Vladislav Shpilevoy authored
      ev_timer.at was used as timeout. But after ev_timer_start() it
      turns into the deadline - totally different value.
      
      The patch makes sure ev_timer.at is not used in raft at all.
      
      To test that the fakeev subsystem is patched to start its time not
      from 0. Otherwise ev_timer.at often really matched the timeout
      even for an active timer.
      e51c61ae
    • Vladislav Shpilevoy's avatar
      raft: fix crash on election_timeout reconfig · 82757e55
      Vladislav Shpilevoy authored
      It used to crash if done during election on a node voted for
      anybody, it is a candidate, it doesn't know a leader yet, but has
      a WAL write in progress.
      
      Thus it could only happen if the term was bumped by a message from
      a non-leader node and wasn't flushed to the disk yet.
      
      The patch makes the reconfig check if there is a WAL write in
      progress. Then don't do anything.
      
      Could also check for volatile vote instead of persistent, but it
      would create the same problem for the case when started writing
      vote for self and didn't finish yet. Reconfig would crash.
      82757e55
    • artembo's avatar
      github-ci: add fedora-35 workflows · d3d04b49
      artembo authored
      Add GitHub Actions workflows for Fedora 35
      Closes: #6692
      d3d04b49
  2. Jan 20, 2022
    • Serge Petrenko's avatar
      test: fix replication/errinj potential flakiness · 2b975e49
      Serge Petrenko authored
      The test has a function wait_repl() which tries to wait until the data
      is replicated to the other node for a tiny timeout (0.2 seconds)
      
      This didn't cause issues in the past, but it became an issue after
      applier in thread introduction.
      
      Let's use the default test_run:wait_cond() approach instead of a custom
      one. This way we increase waiting timeout (making the test pass with a
      higher chance).
      
      Follow-up #6329
      2b975e49
    • Serge Petrenko's avatar
      test: fix replication/gh-5806-xlog-cleanup potential flakiness · d552a1ed
      Serge Petrenko authored
      Follow-up #6329
      d552a1ed
    • Serge Petrenko's avatar
      Introduce applier thread · dacbf708
      Serge Petrenko authored
      It's reported that in master-slave setup replicas often have higher CPU
      usage than their replication masters. Moreover, it's easy for a replica
      to start falling behind the master.
      
      The reason for that is the additional work load on replica's tx thread  as
      compared to master. While master typically splits request processing into 2
      threads: iproto, which decodes the requests, and tx, which applies them,
      replica performs both tasks in the tx thread.
      
      This is due to replication architecture: replica handles master
      connection by a single fiber in the tx thread. The fiber first decodes the
      incoming requests and then applies them.
      
      Teach replicas to decode the incoming replication stream in a separate
      thread. This way tx thread doesn't waste processing time on row
      decoding.
      
      Each applier thread may serve several appliers, and the total number of
      applier threads is controlled by a new configuration option -
      `replication_threads`, with default value `1` (meaning, a single
      thread is spawned to handle all the appliers.
      
      Closes #6329
      
      @TarantoolBot document
      Title: New configuration option - `replication_threads`
      
      It's now possible to specify how many threads will be spawned to decode
      the incoming replication stream.
      
      The default value is '1', meaning a single thread will handle all
      incoming replication streams.
      
      You may set the value to anything from 1 to 1000. When there are
      multiple replication threads, connections to serve are evenly
      distributed between the threads.
      dacbf708
  3. Jan 19, 2022
    • Vladimir Davydov's avatar
      Add SSL iostream stub · a7028dde
      Vladimir Davydov authored
      This commit adds SSL context to iostream_ctx and a new kind of error for
      SSL connections.
      
      The SSL context is created if the target URI has transport=ssl
      parameter. If transport=plain or absent, it will be set to NULL and
      plain streams will be created as before. For other values of the
      transport parameter, an error is raised. Note, this is just a stub -
      an attempt to create an SSL context always currently fails with
      "SSL not available" error. It is supposed to be implemented in
      EE build.
      
      The new kind of error is currently only used for decoding errors from
      MsgPack and never raised. It will be raised by the actual implementation
      of SSL stream.
      a7028dde
    • Vladimir Davydov's avatar
      box: make cfg value comparison more thorough · 2734785e
      Vladimir Davydov authored
      Use table.equals for comparing table-valued configuration parameters
      instead of ipairs. Needed to trigger reconfiguraiton if the new URI
      differs from the old one only by parameters, e.g.:
      
        box.cfg{listen = {uri = 3301, params = {transport = 'plain'}}}
        box.cfg{listen = {uri = 3301, params = {transport = 'ssl'}}}
      
      No test is added, because currently there's no URI parameters handled
      by box. The next commit adds the 'transport' parameter and a test that
      wouldn't pass without this commit.
      2734785e
    • Vladimir Davydov's avatar
      iostream: introduce context and use it for creating streams · 26482e90
      Vladimir Davydov authored
      IO stream context (iostream_ctx) stores information needed to construct
      an iostream object.  A context is created from URI and mode, which is
      either server or client. Currently, both parameters are ignored and a
      newly created context always constructs plain streams. However, in
      future we will create SSL streams for certain URIs. That's when we'll
      need the mode (SSL connection is asymmetrical).
      26482e90
    • Vladimir Davydov's avatar
      iostream: rename ctx to data · 0c4e6374
      Vladimir Davydov authored
      In SSL implementation iostream::ctx would point to a SSL object, while
      a SSL_CTX object would be used for creating streams. Let's rename ctx to
      data to avoid confusion.
      0c4e6374
    • Vladimir Davydov's avatar
      box: inline cfg_get_replication · a07f9143
      Vladimir Davydov authored
      The function is used only once, in box_sync_replication. Inlining it
      makes the code more robust - it allows us to throw from applier_new.
      a07f9143
    • Vladimir Davydov's avatar
      evio: pass iostream instead of fd (and uri) to on_accept callback · 7122f0f5
      Vladimir Davydov authored
      Currently, we always create a plain stream, but soon there will be an
      option to create an encrypted stream so let's pass iostream, which will
      encapsulate this information, instead of fd to the accept callback. The
      iostream will be created by evio in accordance with the settings passed
      in uri parameters so uri won't be needed in the accept callback.
      7122f0f5
    • Vladimir Davydov's avatar
      coio: drop coio_service · efee67ca
      Vladimir Davydov authored
      It's been many years since it was last used. I'm tired of patching it
      whenever I need to update evio_service. Besides, it decreases code
      coverage. So let's finally drop it. After all, it's just a few lines
      of trivial code that can be rewritten from scratch any time we need.
      efee67ca
    • Vladimir Davydov's avatar
      Rename iostream_create to plain_iostream_create · 34a7cfa8
      Vladimir Davydov authored
      The function creates a plain iostream so let's rename it accordingly.
      34a7cfa8
    • Vladimir Davydov's avatar
      net.box: allow to pass table uri to connect · 23a7ce80
      Vladimir Davydov authored
      There are two acceptable ways of calling `connect` - as a method of
      the net.box module or as a function defined in the module:
      
      ```lua
      local net = require('net.box')
      net.connect(...)
      net:connect(...)
      ```
      
      We determine which one is used by checking the type of the first
      argument: if it's a table, we assume that the function is called as
      a method. However, the first argument can be a table itself - in case
      it's a URI given in the extended format.
      
      Let's fix this check by comparing the first argument against the net.box
      module. Let's also add a test checking all possible combinations of
      `connect` arguments.
      
      Follow-up 0badb413 ("net.box: pass uri
      instead of host and port to state machine").
      23a7ce80
  4. Jan 18, 2022
    • Vladimir Davydov's avatar
      test: fix flaky engine/errinj_ddl test · 197088c3
      Vladimir Davydov authored
      The commit fixes the following test failure:
      
      ```
      [011] engine/errinj_ddl.test.lua                      memtx           [ fail ]
      [011]
      [011] Test failed! Result content mismatch:
      [011] --- engine/errinj_ddl.result      Tue Jan 18 15:28:21 2022
      [011] +++ var/rejects/engine/errinj_ddl.reject  Tue Jan 18 15:28:26 2022
      [011] @@ -343,7 +343,7 @@
      [011]  s:create_index('sk', {parts = {2, 'unsigned'}}) -- must fail
      [011]  ---
      [011]  - error: Duplicate key exists in unique index "sk" in space "test" with old tuple
      [011] -    - [101, 101, "xxxxxxxxxxxxxxxx"] and new tuple - [100, 101]
      [011] +    - [100, 101] and new tuple - [101, 101, "xxxxxxxxxxxxxxxx"]
      [011]  ...
      [011]  ch:get()
      [011]  ---
      ```
      
      The test is inherently racy: a conflicting tuple may be inserted to the
      new index either by the index build procedure or by the test fiber doing
      DML in the background. The error messages will disagree regarding what
      tuple should be considered old and which one new. Let's match the error
      message explicitly.
      
      The failure was introduced by d11fb306
      ("box: change ER_TUPLE_FOUND message") which enhanced error messages
      with conflicting tuples.
      197088c3
    • Georgiy Lebedev's avatar
      core: fix testing tuple field count overflow · 41fdd2a8
      Georgiy Lebedev authored
      Testing tuple field count overflow handling requires creating a severely
      large tuple with box.schema.FIELD_MAX (INT32_MAX) fields: introduce an
      error injection for testing this corner case.
      
      Fixes #6684
      41fdd2a8
  5. Jan 17, 2022
  6. Jan 14, 2022
    • Vladimir Davydov's avatar
      test: fix flaky vinyl/gh-4810-dump-during-index-build test · 5cd399b7
      Vladimir Davydov authored
      The commit fixes the following test failure:
      
      ```
      [082] vinyl/gh-4810-dump-during-index-build.test.lua                  Test timeout of 310 secs reached	[ fail ]
      [082]
      [082] Test failed! Result content mismatch:
      [082] --- vinyl/gh-4810-dump-during-index-build.result	Thu Dec  9 05:31:17 2021
      [082] +++ /build/usr/src/debug/tarantool-2.10.0~beta1.324.dev/test/var/rejects/vinyl/gh-4810-dump-during-index-build.reject	Thu Dec  9 06:51:03 2021
      [082] @@ -117,34 +117,3 @@
      [082]  for i = 1, ch:size() do
      [082]      ch:get()
      [082]  end;
      [082] - | ---
      [082] - | ...
      [082] -
      ...
      ```
      
      The test hangs waiting for the test fibers to exit. There are two test
      fibers - one builds an index, another populates the test space. The
      latter uses pcall so it always returns. The one that builds an index,
      however, doesn't. The problem is index build may fail because it builds
      a unique index while the fiber populating the space may insert
      non-unique values. Fix this by building a non-unique index instead,
      which should never fail. To reproduce the issue the test checks is fixed
      one can build any index, unique or non-unique, so it should be fine.
      
      Closes #5508
      5cd399b7
    • Vladimir Davydov's avatar
      test: fix flaky vinyl/gh test failure · cc6c328d
      Vladimir Davydov authored
      The commit fixes the following test failure:
      
      ```
      [005] vinyl/gh.test.lua                                               [ fail ]
      [005]
      [005] Test failed! Result content mismatch:
      [005] --- vinyl/gh.result	Mon Dec 13 15:03:45 2021
      [005] +++ /root/actions-runner/_work/tarantool/tarantool/test/var/rejects/vinyl/gh.reject	Fri Dec 17 10:41:24 2021
      [005] @@ -716,7 +716,7 @@
      [005]  ...
      [005]  test_run:wait_cond(function() return finished == 2 end)
      [005]  ---
      [005] -- true
      [005] +- false
      [005]  ...
      [005]  s:drop()
      [005]  ---
      ```
      
      The reason of the failure is that the fiber doing checkpoints fails,
      because a checkpoint may be already running by the checkpoint daemon.
      Invoke box.snapshot() under pcall to make the test more robust.
      
      Part of #5141
      cc6c328d
    • Vladimir Davydov's avatar
      test: fix flaky vinyl/deferred_delete test · 7f8c549b
      Vladimir Davydov authored
      The commit fixes the following test failure:
      
      ```
      [019] vinyl/deferred_delete.test.lua                                  [ fail ]
      [019]
      [019] Test failed! Result content mismatch:
      [019] --- vinyl/deferred_delete.result	Tue Jan 11 11:10:22 2022
      [019] +++ /build/usr/src/debug/tarantool-2.10.0~beta2.37.dev/test/var/rejects/vinyl/deferred_delete.reject	Fri Jan 14 11:45:26 2022
      [019] @@ -964,7 +964,7 @@
      [019]  ...
      [019]  sk:stat().disk.dump.count -- 1
      [019]  ---
      [019] -- 1
      [019] +- 0
      [019]  ...
      [019]  sk:stat().rows - dummy_rows -- 120 old REPLACEs + 120 new REPLACEs + 120 deferred DELETEs
      [019]  ---
      ```
      
      The test checks that compaction of a primary index triggers dump of
      secondary indexes of the same space, because it generates deferred
      DELETE statements. There's no guarantee that by the time compaction
      completes, secondary index dump have been completed as well, because
      compaction may ignore the memory quota (it uses vy_quota_force_use in
      vy_deferred_delete_on_replace). Make the check more robust by using
      wait_cond.
      
      Follow-up #5089
      7f8c549b
    • Vladimir Davydov's avatar
      test: use wait_cond in vinyl/deferred_delete test · 8c913a10
      Vladimir Davydov authored
      It's better than hand-written busy-wait.
      8c913a10
    • Vladimir Davydov's avatar
      test: fix flaky vinyl/gc test · cd9fd77e
      Vladimir Davydov authored
      The commit fixes the following test failure:
      
      ```
      [013] vinyl/gc.test.lua                                               [ fail ]
      [013]
      [013] Test failed! Result content mismatch:
      [013] --- vinyl/gc.result	Fri Dec 24 12:27:33 2021
      [013] +++ /build/usr/src/debug/tarantool-2.10.0~beta2.18.dev/test/var/rejects/vinyl/gc.reject	Thu Dec 30 10:29:29 2021
      [013] @@ -102,7 +102,7 @@
      [013]  ...
      [013]  check_files_number(2)
      [013]  ---
      [013] -- true
      [013] +- null
      [013]  ...
      [013]  -- All records should have been purged from the log by now
      [013]  -- so we should only keep the previous log file.
      ```
      
      The reason of the failure is that vylog files are deleted asynchronously
      (`box.snapshot()` doesn't wait for `unlink` to complete) since commit
      8e429f4b ("wal: remove old xlog files
      asynchronously"). So to fix the test, we just need to make the test wait
      for garbage collection to complete.
      
      Follow-up #5383
      cd9fd77e
    • mechanik20051988's avatar
      small: fix assertion during slab allocation · 68c29688
      mechanik20051988 authored
      When `slab_get` is called from `region_alloc` or `ibuf_alloc` first
      of all we try to calculate order of appropriate slab. But there is
      no check that requested size with slab meta is <= UINT32_MAX, that
      leads to assertion failer in `slab_order` function. There is no
      need for this assertion we should return `cache->order_max + 1`
      for this case.
      
      Closes #6726
      68c29688
  7. Jan 13, 2022
  8. Jan 12, 2022
  9. Jan 10, 2022
  10. Jan 04, 2022
  11. Dec 30, 2021
Loading