Skip to content
Snippets Groups Projects
  1. Sep 15, 2017
  2. Sep 14, 2017
  3. Sep 13, 2017
  4. Sep 12, 2017
  5. Sep 11, 2017
    • Georgy Kirichenko's avatar
      replication: reconnect applier on cfg error · 52268eda
      Georgy Kirichenko authored
      Sometimes old relay instance couldn't be deleted yet before new
      slave subscribe is there. For this case an invalid cfg error is
      returned, and applier should reconnect after timeout.
      
      Fixes #2277
      52268eda
    • Georgy Kirichenko's avatar
      replication: add a test case for timeouts · 7bf7a0d1
      Georgy Kirichenko authored
      Fixes #2707
      7bf7a0d1
    • Georgy Kirichenko's avatar
      Configure applier timeouts via box.cfg · 42f8d9d8
      Georgy Kirichenko authored
      Set applier reconnect delay and ack interval (hearthbeat interval) via
      box.cfg replication_timeout parameter. Relay timeout (time interval
      without hearthbeat messages) is four times bigger than replication_timeout,
      so up to three hearthbeat messages can be skipped until connection to close.
      Fixed #2708
      42f8d9d8
    • Vladimir Davydov's avatar
      vinyl: fix read iterator restoration to a newer version of the same key · 61ffe793
      Vladimir Davydov authored
      After the read iterator selects the minimal key across all available
      sources, it checks mutable sources for new statements using ->restore()
      callback. If there is a new statement in a source, it uses it as the min
      key provided it is *strictly* less than the current min key. If they are
      equal, the min key isn't changed, but this is wrong, because the new
      statement may be newer than the statement selected previously. If we
      don't select it, we might end up with stale data in the cache. Fix this.
      61ffe793
    • Vladimir Davydov's avatar
      vinyl: simplify cache iterator restore · 557b4026
      Vladimir Davydov authored
      Since ->restore() is not used by the read iterator to start iteration
      any more, we can remove the corresponding code from the cache iterator
      ->restore() callback. Although it might be tempting to simplify it even
      more by doing a full lookup every time the cache version changes, as we
      already do in case of memory and txw iterators, it doesn't seem to be a
      sound idea, because the read iterator itself can change the cache
      version on each iteration by inserting new elements into the cache, even
      if there were no disk accesses.
      557b4026
    • Vladimir Davydov's avatar
      vinyl: simplify txw iterator restore · d7342aa5
      Vladimir Davydov authored
      We don't need to handle iterator restart in the ->restore() callback, so
      we can remove the corresponding code. Also, let's reuse the start
      iteration function for restoration, because the two cases are in fact
      equivalent.
      d7342aa5
    • Vladimir Davydov's avatar
      vinyl: simplify run iterator restore · eebba30e
      Vladimir Davydov authored
      After the recent changes in the read iterator, the ->restore() callback
      does not need to handle the case of iterator restart any more. Taking
      this into account and keeping in mind that on-disk runs are immutable,
      we can turn the run iterator ->restore() callback into no-op.
      eebba30e
    • Vladimir Davydov's avatar
      vinyl: simplify memory iterator restore · 44a62002
      Vladimir Davydov authored
      To avoid lookup in the memory tree, the memory iterator ->restore()
      callback tries to walk from the current iterator position to the first
      statement matching the restoration criteria. Such an optimization
      complicates the restoration procedure beyond comprehension and makes it
      extremely error prone. Ironically, all this complexity seems to be
      pointless, because a change in the memory tree means either a disk
      access, which is by orders of magnitudes more expensive than a memory
      lookup, or an insertion of a new statement into the tree, which has
      exactly the same complexity as a lookup. That said, let's rewrite the
      restoration procedure so that it always does a full lookup in case the
      version of the memory tree has changed.
      
      Also, remove handling of iterator restart and the corresponding test
      case as a ->restore() callback does not need to handle them any more.
      44a62002
    • Vladimir Davydov's avatar
      vinyl: do not use restore callback for starting read iterator source · 0feb32b8
      Vladimir Davydov authored
      Apart from restoring the iterator position in case the source changed,
      the vy_stmt_iterator_iface->restore callback is also used for starting
      iteration in vy_merge_iterator_next_key() even though next_key() can be
      used instead. Let's rewrite the function so that it uses next_key()
      instead of restore() where appropriate. This will allow us to simplify
      restore() by making it handle nothing but iterator restoration.
      0feb32b8
  6. Sep 10, 2017
    • Vladimir Davydov's avatar
      vinyl: do not use restore callback for restarting read iterator · 7675313a
      Vladimir Davydov authored
      The read iterator has to restart (i.e. reopen all its sources) from the
      position last returned to the caller when the current range or the whole
      range tree changes as a result of dump or compaction. To reposition the
      iterator, we use vy_stmt_iterator_iface->restore callback, which was
      initially designed to restore an individual merge source (txw, mem, or
      cache) after a statement is added to or removed from it. Abusing the
      callback like that complicates its implementation as well as the read
      iterator itself. We can avoid that by simply reopening merge sources
      with the proper key when we need to restart the read iterator.
      7675313a
    • Vladimir Davydov's avatar
      vinyl: zap vy_stmt_iterator_iface->cleanup · 8cb06ffe
      Vladimir Davydov authored
      The 'cleanup' callback is always called together with 'close'. The two
      callbacks were separated long time ago, when vy_merge_iterator was used
      for writing runs. There is no point in keeping them apart any more.
      8cb06ffe
  7. Sep 08, 2017
  8. Sep 07, 2017
    • Vladimir Davydov's avatar
      vinyl: fix column mask when statement is overwritten in transaction · 960aad6a
      Vladimir Davydov authored
      Statement generated by the following piece code ({1, 1, 2}) isn't dumped
      to the secondary index:
      
          s = box.schema.space.create('test', {engine = 'vinyl'})
          s:create_index('i1', {parts = {1, 'unsigned'}})
          s:create_index('i2', {parts = {2, 'unsigned'}})
      
          box.begin()
          s:insert{1, 1, 1}
          s:update(1, {{'+', 3, 1}})
          box.commit()
      
      This happens, because UPDATE is replaced with DELETE + REPLACE in the
      transaction log both of which have colun_mask = 0x04 (field #3 is
      updated). These statements overwrite the original INSERT in the memory
      index on commit, but they are not dumped, because their column_mask does
      not intersect with the column mask of the secondary index (0x02).
      
      To avoid that, the new statement (UPDATE = DELETE + REPLACE in this
      case) must inherit the column mask of the overwritten statement
      (REPLACE).
      
      Fixes #2745
      960aad6a
  9. Sep 06, 2017
Loading