Skip to content
Snippets Groups Projects
  1. Sep 25, 2017
    • Vladimir Davydov's avatar
      salad: light: make C compatible · abc9d055
      Vladimir Davydov authored
       - Use 'static inline' instead of 'inline'
       - Move GROW_INCREMENT enum out of LIGHT(record) struct
      abc9d055
    • Vladimir Davydov's avatar
      vinyl: do not start reader threads if vinyl is unused · 57e8ff91
      Vladimir Davydov authored
      So as not to confuse the user, let's start reader threads when recovery
      completes only if there are Vinyl indexes. Otherwise, start them on the
      first Vinyl index creation.
      
      See #2664
      57e8ff91
    • Vladimir Davydov's avatar
      vinyl: do not start worker threads on checkpoint if vinyl is unused · b98a38ba
      Vladimir Davydov authored
      Vinyl starts its worker threads on checkpoint, even if there is no Vinyl
      spaces to dump out there. This is a mess. Let's wake up the scheduler
      only if we actually have something to dump. BTW, this patch removes that
      annoying 'vinyl checkpoint done' message in case nothing was dumped.
      
      See #2664
      b98a38ba
    • Vladimir Davydov's avatar
      vinyl: factor out scheduler checkpoint functions · 0dc8d031
      Vladimir Davydov authored
      Introduce the following functions:
      
        vy_scheduler_begin_checkpoint()
        vy_scheduler_wait_checkpoint()
        vy_scheduler_end_checkpoint()
      
      and make the Vinyl API methods use them instead of playing with the
      scheduler directly.
      
      Rationale:
       - It will help move the scheduler to a separate file in future.
       - We want to avoid waking the scheduler on checkpoint if Vinyl is not
         used, because the scheduler starts worker threads on the first
         wakeup. At the same time, we have to call vy_log_rotate() on
         checkpoint no matter if Vinyl is used or not (it needs to update its
         internal housekeeping). Factoring out the scheduler functions will
         allow to achieve this goal neatly.
      0dc8d031
    • Vladimir Davydov's avatar
      vinyl: use checkpoint_last() instead of vy_scheduler->last_checkpoint · d6d70836
      Vladimir Davydov authored
      There's no point in maintaining the LSN of the last checkpoint in Vinyl,
      we have checkpoint_last() for retrieving it. Make this helper a little
      bit more friendly by allowing to omit vclock argument and use it
      wherever appropriate.
      
      Here's why I need to do that now. I'm planning to omit calling scheduler
      checkpoint functions altogether if there's nothing to dump (so as not to
      start worker threads and print 'vinyl checkpoint done' message in case
      Vinyl is not used), but one of those functions updates last_checkpoint,
      which other pieces of code (gc primarily) relies on. I could factor
      last_checkpoint out of vy_scheduler, but why if I can simply use
      checkpoint_last() instead.
      d6d70836
    • Vladimir Davydov's avatar
      box: do not invoke garbage collection on checkpoint_count change · 884abc0b
      Vladimir Davydov authored
      Currently, box_set_checkpoint_count() not only changes the corresponding
      configuration option, but also invokes garbage collection. The problem
      is it is called in the beginning of box_cfg(), before recovering engine
      data. At that time engines are not ready to invoke garbage collection
      (e.g. Vinyl hasn't scanned vylog directory yet). Besides, the server
      might be started in the hot standby mode, in which case calling garbage
      collection is obviously wrong.
      
      To fix this, we could somehow detect if box_set_checkpoint_count() is
      called from box_cfg() and avoid invoking the garbage collector if so,
      but I think it isn't worth it. Instead let's just not invoke garbage
      collection when this option changes. It's not a big deal - old files
      will be removed by the next snapshot anyway.
      884abc0b
    • Vladimir Davydov's avatar
      vinyl: check existence of vinyl data directory on demand · 114f0403
      Vladimir Davydov authored
      It's inappropriate to fail startup if the vinyl data directory does not
      exist, because vinyl might not even be in use. Move the check to the
      time when a vinyl index is opened.
      
      See #2664
      114f0403
    • Vladimir Davydov's avatar
      vinyl: fix gc of incomplete runs left from dropped indexes · e8e7ed18
      Vladimir Davydov authored
      If an index is dropped while a dump/compaction task is in progress, the
      task will be aborted, but VY_LOG_DROP_RUN record won't be written to the
      metadata log so the run will remain incomplete (VY_LOG_PREPARE_RUN) and
      pin the dropped index in the log until the server is restarted and all
      incomplete runs are purged. This results in occasional failures of the
      vinyl/gc test which checks that vylog files are removed after all vinyl
      spaces are dropped. There's actually no reason not to log deletion of an
      incomplete run that belongs to a dropped index so let's do this to fix
      this problem.
      
      Closes #2486
      e8e7ed18
    • Vladimir Davydov's avatar
      memtx: undef BPS tree macros used to define memtx_tree · 622c4bcf
      Vladimir Davydov authored
      So that BPS tree can be redefined in files that include memtx_tree.h
      622c4bcf
  2. Sep 22, 2017
    • Roman Tsisyk's avatar
      tarantoolctl: fix "attempt to index local 'cfg'" · 873632f2
      Roman Tsisyk authored
      Fixes #2761
      873632f2
    • Roman Tsisyk's avatar
      curl: prefer version from homebrew on macOS · 947b378d
      Roman Tsisyk authored
      Apple's version of libcurl is outdated and buggy.
      Use libcurl from homebrew by default.
      
      Closes #2772
      947b378d
    • Eugene Leonovich's avatar
      doc: tweak extra/dist/example.lua · 563fcafc
      Eugene Leonovich authored
      queue.start() is not needed anymore.
      563fcafc
    • Roman Tsisyk's avatar
      vinyl: fix error injection in vy_cache_iterator_restore() · e80c3ecb
      Roman Tsisyk authored
      Follow up the previous commit.
      e80c3ecb
    • Vladimir Davydov's avatar
      vinyl: rework cache iterator restore · 073c8d07
      Vladimir Davydov authored
      The cache iterator restoration function is muddy and suboptimal:
      
       - If last_stmt equals NULL, it doesn't attempt to change the iterator
         position although it should restart the iterator. Moreover, it
         doesn't even check EQ condition in this case, i.e. it may return a
         statement that doesn't satisfy the search criteria.
      
       - It may restore iterator position to last_stmt, but the restoration
         semantics mandates that the returned statement must be strictly
         greater than last_stmt if the iterator was restored.
      
       - If the iterator was invalidated, it first positions the iterator to
         the last known position (curr_stmt) and then steps back to the
         statement closest to last_stmt although it could jump to last_stmt
         immediately.
      
      Let's rewrite it.
      073c8d07
    • Vladimir Davydov's avatar
      vinyl: clean up upsert squashing procedure of read iterator · 98ac5be8
      Vladimir Davydov authored
      vy_merge_iterator_squash_upserts() returns an UPSERT, which is then
      converted to a REPLACE by vy_read_iterator_next(). Fold the latter into
      the former to make the workflow easier to follow. Also, remove useless
      suppress_error argument.
      98ac5be8
    • Vladimir Davydov's avatar
      vinyl: do not handle restore in next_key/next_lsn callbacks · 6fb87432
      Vladimir Davydov authored
      Not only restore() callback can restore the iterator position after the
      source changed - next_key() and next_lsn() can do that too, which brings
      additional complexity. Do we really need it? Not really:
      
       - We can avoid handling restoration in next_key() by simply calling
         restore() before it. This is cheap as restore() is a no-op if the
         source was not changed.
      
       - Regarding next_lsn() - when it comes to calling it, we iterate over
         sources from the most recent one to the oldest, which means that the
         only sources out there that may yield, on-disk runs, are guaranteed
         to be iterated last, after all mutable sources (txw, cache, mems), so
         none of the mutable sources needs to be restored in this case.
      
      Simplify the read iterator as per above.
      6fb87432
    • Vladimir Davydov's avatar
      vinyl: make sure next_lsn callback is only called after next_key · e5229867
      Vladimir Davydov authored
      Currently, ->next_lsn() may be (and actually is) called right after
      opening the iterator, which means that apart from advancing the iterator
      to the next version of the same statement it has to handle the case of
      starting iteration. This complicates the callback semantics so let's
      require ->next_key() to be called first.
      e5229867
  3. Sep 21, 2017
  4. Sep 20, 2017
  5. Sep 19, 2017
    • Vladimir Davydov's avatar
      box: implement persistent sequences · f797eec4
      Vladimir Davydov authored
      This patch implements a new object type, persistent sequences. Sequences
      are created with function box.schema.sequence.create(name, options).
      Options include min/max, start value, increment, cache size, just like
      in Postgresql, although 'cache' is ignored for now. All sequences can be
      accessed via box.sequence.<name>, similarly to spaces. To generate a
      sequence value, use seq:next() method. To retrieve the last generated
      value, use seq:get(). A sequence value can also be reset to the start
      value or to any other value using seq:reset() and seq:set() methods.
      
      Needed for #389
      f797eec4
    • Vladimir Davydov's avatar
      box: use trigger to push space data to Lua · 1f736583
      Vladimir Davydov authored
      Currently, it is done by space_cache_replace/delete which violates
      incapsulation. Let's introduce a trigger that is fired after a change in
      a space definition is committed and use it to propagate changes to Lua.
      Patch by @kostja.
      1f736583
    • lenkis's avatar
      Update man file for tarantool · fca3d686
      lenkis authored
      fca3d686
    • Vladimir Davydov's avatar
      box: add boolean field type · 702bcac2
      Vladimir Davydov authored
      702bcac2
  6. Sep 18, 2017
  7. Sep 15, 2017
Loading