Skip to content
Snippets Groups Projects
  1. Sep 28, 2016
  2. Sep 27, 2016
    • Konstantin Osipov's avatar
      tuple: in attempt to be more merge-compatible with 1.8, move code around · e5f67b90
      Konstantin Osipov authored
      Move the ANY index type to tuple_compare.cc to simplify merges with 1.8.
      Remove dead code.
      
      Collateral: fix a release mode warning in vinyl.
      e5f67b90
    • Nick Zavaritsky's avatar
      Wrap net.box.transport GC finalizer in pcall · e1e5d4ae
      Nick Zavaritsky authored
      Raising errors from GC finalizers is apparently not supported.
      The error was due to the finalizer running in net.box.transport
      worker fiber by chance. Hence the fiber was attempting to cancel thyself.
      
      Normal Lua execution is interleaved with GC work, that's why they call
      it incremental GC.
      e1e5d4ae
    • Roman Tsisyk's avatar
      5e1606fe
    • Vladimir Davydov's avatar
      vinyl: fix warnings if compiled with NDEBUG · 69427ded
      Vladimir Davydov authored
      src/box/vinyl.c: In function ‘vy_range_write_run’:
      src/box/vinyl.c:2365:1: error: label ‘create_failed’ defined but not used [-Werror=unused-label]
       create_failed:
       ^
      src/box/vinyl.c: In function ‘vy_task_compact_execute’:
      src/box/vinyl.c:3190:31: error: suggest braces around empty body in an ‘if’ statement [-Werror=empty-body]
                 rc = -1; goto out;});
                                     ^
      src/box/vinyl.c:3208:1: error: label ‘unlink_error’ defined but not used [-Werror=unused-label]
       unlink_error:
       ^
      src/box/vinyl.c: In function ‘vy_mem_iterator_close’:
      src/box/vinyl.c:6829:26: error: unused variable ‘itr’ [-Werror=unused-variable]
        struct vy_mem_iterator *itr = (struct vy_mem_iterator *) vitr;
                                ^
      src/box/vinyl.c: In function ‘vy_txw_iterator_close’:
      src/box/vinyl.c:7087:26: error: unused variable ‘itr’ [-Werror=unused-variable]
        struct vy_txw_iterator *itr = (struct vy_txw_iterator *) vitr;
                                ^
      69427ded
    • Vladimir Davydov's avatar
      vinyl: patch holes in index on recovery · 9532f5be
      Vladimir Davydov authored
      Successful compaction may create a range w/o tuples, and currently we
      don't store empty range files on disk. As a result, such a range won't
      be loaded on recovery, which breaks the index tree invariant (prev->end
      equals next->begin). Hence we must silently create a new range for each
      gap found on recovery.
      9532f5be
    • Vladimir Davydov's avatar
      vinyl: do not remove empty range on split · 1ff57e79
      Vladimir Davydov authored
      Successful merge+split may result in ranges w/o tuples. Before commit
      559102a7 ("vinyl: store range lower and upper bounds on disk") it was OK
      to delete such ranges, because there was no range->end. To illustrate
      this, suppose compaction splits a range as follows:
      
        [A, C) => [A, B) + [B, C)
      
      If range [B, C) turns out to be empty, then we could simply drop it as
      all inserts would go to range [A, B) and as B was not stored anywhere,
      it would effectively become range [A, C).
      
      After the above-mentioned commit, however, removal of range [B, C)
      breaks the index invariant that for each two adjacent ranges prev->end
      always equals next->begin. This, in turn, can result in data loss in
      case [A, B) gets split again, as B will be used to break the run write
      loop (see vy_range_compact_execute()) which is premature since there may
      be tuples >= B.
      
      That being said, let's remove this small optimization altogether.
      1ff57e79
    • Vladimir Davydov's avatar
      vinyl: warn about stale and partial ranges on recovery · ca0445de
      Vladimir Davydov authored
      A "stale" range is an old range file left after compaction. A "partial"
      range is a range file left after failed split. Although we can handle
      such files, they should not normally exist in the index directory, so
      let's warn about their presence on recovery.
      ca0445de
    • Vladimir Davydov's avatar
      Fix vinyl/compact test · 524789c0
      Vladimir Davydov authored
      The vinyl/compact issues two snapshots and expects that there will be
      two runs after it, then it keeps waiting until compaction merges them.
      There is a race condition intrinsic to this test - compaction might have
      finished before the test checks that there are exactly two runs. To
      eliminate it, let's set the test index's compact_wm parameter to 3 and
      add one more snapshot to trigger compaction.
      
      Since currently, it's impossible to modify vinyl options dynamically,
      this patch moves compact_wm to index options where page_size and
      range_size reside.
      
      Closes #1758
      524789c0
    • Konstantin Osipov's avatar
      3b7e4b46
    • Roman Tsisyk's avatar
      77c1da0c
    • Nick Zavaritsky's avatar
      899bc6d8
    • Alexandr Lyapunov's avatar
    • Roman Tsisyk's avatar
      Fix clock_gettime() detection on Linux · cc9ddd75
      Roman Tsisyk authored
      Regression by d36ba279
      cc9ddd75
    • Roman Tsisyk's avatar
      Follow up 3a3f705b · 9ff0ec23
      Roman Tsisyk authored
      9ff0ec23
  3. Sep 26, 2016
    • Nick Zavaritsky's avatar
      Fix gh-1772: broken tarantoolctl eval · 33fc47e5
      Nick Zavaritsky authored
      33fc47e5
    • bigbes's avatar
      Fix broken tarantoolctl usage message · 72a598e7
      bigbes authored
      72a598e7
    • Vladimir Davydov's avatar
      vinyl: remove old range file on compaction asap · 3977c18f
      Vladimir Davydov authored
      Currently, we postpone old range file removal until checkpoint, but we
      can do it right after successful compaction - this will save us some
      disk space.
      3977c18f
    • Konstantin Osipov's avatar
    • Konstantin Osipov's avatar
      vinyl: add a comment for the idea behind vinyl/recover.test · ed36d5da
      Konstantin Osipov authored
      Tweak constants to reduce test execution time.
      ed36d5da
    • Roman Tsisyk's avatar
      Bump versions in RPM and Debian packages · 5d3a66d1
      Roman Tsisyk authored
      5d3a66d1
    • Vladimir Davydov's avatar
      test: vinyl: test recovery after incomplete splits · b094b089
      Vladimir Davydov authored
      The idea behind the test is simple - create several invalid range files,
      i.e. those left from previous dumps and incomplete splits, then restart
      the server and check that the content of the space was not corrupted.
      
      To make it possible, we need to (1) prevent the garbage collector from
      removing unused range files and (2) make the split procedure fail after
      successfully writing the first range. We use error injection to achieve
      that.
      
      The test runs as follows:
      
       1. Disable garbage collection with the aid of error injection.
      
       2. Add a number of tuples to the test space that would make it split.
          Rewrite them several times with different values so that different
          generations of ranges on disk would have different contents.
      
       3. Inject error to the split procedure.
      
       4. Rewrite the tuples another couple of rounds. This should trigger
          split which is going to fail leaving invalid range files with newer
          ids on the disk.
      
       5. Restart the server and check that the test space content was not
          corrupted.
      b094b089
    • Vladimir Davydov's avatar
      vinyl: zap range index · c344dfff
      Vladimir Davydov authored
      Currently, we store all range ids in an .index file after each range
      tree modification. On recovery, we open the latest .index file, get the
      list of all ranges, and load them. This .index file introduces extra
      complexity to the compaction task: as we can get a consistent list of
      all range ids only in the tx thread, we must either write .index file
      from the tx thread (which we do now), or introduce a special task for
      it, which would be scheduled on compaction completion. The former way
      degrades performance of the tx thread, while the latter complicates the
      code.
      
      Actually, we can do range recovery w/o having to maintain .index files:
      as newer ranges always have greater ids, we can just recover ranges
      starting from the greatest id and disregarding ranges that are already
      spanned by the index tree. For instance, suppose range A was split in
      ranges B and C. Then we recover ranges B and C first (they do not
      intersect, so everything's fine), then we get to A and see that it is
      already spanned (by B and C), so we just throw it away. If on split, B
      (or C) was not created for some reason, then A will not be fully spanned
      by the index, and we replace B (or C) with A, still getting a consistent
      index view.
      
      This patch implements the recovery process as per above and removes the
      .index file. Note, to avoid loading stale index data after drop-create,
      we have to name range files not only by id, but also by index lsn (just
      like the .index files). As before, old range file removal is postponed
      until checkpoint.
      c344dfff
    • Vladimir Davydov's avatar
      vinyl: store range lower and upper bounds on disk · 559102a7
      Vladimir Davydov authored
      Rename range->min_key to range->begin, as it actually denotes not the
      minimal key across all entries in the range, but the lower bound of the
      range, and introduce range->end for the upper bound of the range.
      For adjacent ranges left->end == right->begin. If a range is leftmost,
      then range->begin == NULL. If a range is rightmost, then range->end ==
      NULL. Store range->{begin,end} in range file on checkpoint and load them
      on recovery.
      
      This is required by the following patch to check that ranges do not
      intersect.
      559102a7
    • Vladimir Davydov's avatar
      vinyl: init range->path in vy_range_new() · ccea6f32
      Vladimir Davydov authored
      All we need to initialize range->path is range->id and index->path. Both
      are known at the time of range allocation and never change. So let's do
      range->path initialization right in vy_range_new() instead of postponing
      it until range recovery/write.
      ccea6f32
Loading