Skip to content
Snippets Groups Projects
  1. Aug 04, 2017
  2. Aug 03, 2017
  3. Aug 02, 2017
  4. Aug 01, 2017
  5. Jul 31, 2017
    • Vladimir Davydov's avatar
      recovery: do not stall replication on unfinished xlog · da85fd2a
      Vladimir Davydov authored
      recover_remaining_wals() doesn't proceed to the next xlog until the
      current one is finalized (EOF marker is written). As a result, if an
      xlog wasn't finalized for some reason (IO error occurred or tarantool
      was killed in cold blood with SIGKILL), replication will stall on the
      unfinished xlog forever.
      
      To preclude that, let's differentiate WAL write and rotation in WAL
      watcher and force recover_remaining_wals() rescan the WAL directory on
      any WAL rotation so that it will continue to the next WAL even if the
      current one wasn't properly finalized. In case of hot standby, we can't
      reliably detect WAL rotation (e.g. on Mac OS inotify may not work) so
      also rescan the WAL directory every wal_dir_rescan_delay seconds.
      
      Closes #2294
      da85fd2a
    • Vladimir Davydov's avatar
      relay: cleanup error handling · b51b7a0f
      Vladimir Davydov authored
       - Handle cord_costart() errors properly.
       - Don't use scoped_guard as we don't actually need it there.
       - Drop relay_destroy() and rename relay_create() to relay_init().
      b51b7a0f
    • Vladimir Davydov's avatar
      Use cbus for delivering notifications from WAL to relay · 2b5aa3fc
      Vladimir Davydov authored
      Instead of notifying relay about new WALs with ev_async, establish a
      cbus connection between WAL and each relay and send cbus messages after
      wal_write. This is more flexible, because unlike ev_async we can pass
      extra information along with cbus messages, e.g. LSN or event mask.
      
      Closes #2275
      2b5aa3fc
    • Vladimir Davydov's avatar
    • Vladimir Davydov's avatar
      cbus: add pair/unpair helpers · 34a7ec70
      Vladimir Davydov authored
      This patch introduces cbus_pair() and cbus_unpair() helpers to
      pair/unpair two existing cbus endpoints in one function call.
      
      cbus_pair() creates pipes from the caller's cord to the given
      destination and back. It blocks the caller until both pipes are
      created. The caller may specify a callback to be called at the
      destination right after the pipe to the source has been created,
      which may be useful for preparing the destination to receiving
      messages from the source.
      
      cbus_unpair() initiates destruction of pipes created with cbus_pair()
      and blocks the caller until destruction is complete. Since there may
      be messages queued at the destination endpoint when this function is
      called, before proceeding to pipe destruction this function flushes
      all messages at the destination by sending an empty message from the
      source to the destination and back. The caller may specify a callback
      to be invoked by this message at the destination endpoint. This can
      be used to notify the destination that the channel is about to be
      destroyed and it must stop generating new messages.
      34a7ec70
    • Georgy Kirichenko's avatar
      Fix unw_context initialization · 64aab50c
      Georgy Kirichenko authored
      Use local unw_context variable instead of passing a pointer to a backtrace
      function.
      64aab50c
    • Konstantin Osipov's avatar
      box: initialize index_def::cmp_def in index_def constructor · a143212d
      Konstantin Osipov authored
      We're going to need a key def of secondary key augmented
      with key parts from the primary key in memtx engine as well.
      Initialize it when creating struct index_def.
      
      This patch reverts f42e1c15,
      i.e. the fix for gh-2386 (box_index_key_def() as part of module
      API). Exporting this function to C API was premature. Luckily
      it is not used anywhere except 1.8. For 1.8 this patch introduces
      a faster function, space_index_key_def(), which takes a pointer
      to space rather than space id.
      a143212d
    • Konstantin Osipov's avatar
      box: refactor index_def constructor · 15d8bec8
      Konstantin Osipov authored
      In the next patch I plan to add one more parameters to index_def
      constructor, namely the primary key def.
      Refactor the constructor to expect a fully constructed key_def as an
      argument.
      
      The patch happens to simplify the code in schema.cc, cluttered by
      index_def vs. key_def split.
      15d8bec8
    • Roman Tsisyk's avatar
      vinyl: don't limit tuple arena size twice · c504c89f
      Roman Tsisyk authored
      Since 2ab97c01 "introduce vy_stmt_env and vinyl_max_tuple_size option"
      Vinyl's memory is limited both by `struct quota` and `struct vy_quota`.
      This causes sporadic allocation errors because `vy_quota` may
      exceed in some cases.
      
      Closes #2629
      c504c89f
    • Roman Tsisyk's avatar
      xlog: fix incorrect IOV_MAX detection on new libc · 5d4dcc7e
      Roman Tsisyk authored
      sysconf(_SC_IOV_MAX) can return -1 on glibc 2.25.90.
      
      Closes #2637
      5d4dcc7e
  6. Jul 30, 2017
    • Vladislav Shpilevoy's avatar
      schema: forbid creating a space with id = 0 · 857e6429
      Vladislav Shpilevoy authored
      We do not store id = 0 in xlog, yet when parsing the log
      file expect space id to be present in a request (a mandatory key).
      
      So a space with id 0 is not possible to recovery from a
      snapshot.
      
      Simply reserve id 0 to avoid the problem.
      857e6429
  7. Jul 28, 2017
  8. Jul 27, 2017
    • Konstantin Osipov's avatar
      vinyl: rename user_key_def to key_def · 69b3eea4
      Konstantin Osipov authored
      In memtx, key_def is what a user has defined. Follow the same style
      in vinyl.
      69b3eea4
    • Konstantin Osipov's avatar
      vinyl: rename key_def to cmp_def · d28d1ebe
      Konstantin Osipov authored
      In vinyl, key_def variable name stands for a key definition
      extended with the primary key parts. We will begin using the
      same technique in memtx, so introduce a consistent naming:
      use the word "key_def" for the original key def as defined by
      the user, and cmp_def for the key def used to compare tuples,
      i.e. extended with primary key parts to produce a stable compare
      order.
      
      Begin with introducing the name change in vy_mem.[hc]
      Continue on to vy_index, vy_run, vy_range, vy_slice, vy_stmt,
      and vy_write/read iterators.
      d28d1ebe
    • Roman Tsisyk's avatar
      Fix hardware crc32 detection · 7814ab1c
      Roman Tsisyk authored
      Add missing #include <trivia/config.h>
      
      Fixes #2635
      7814ab1c
    • Georgy Kirichenko's avatar
      Disable ddl for on_replace triggers · 87fb9470
      Georgy Kirichenko authored
      Do not allow ddl if fired from on_replace trigger.
      
      Fixes #1968
      87fb9470
    • Georgy Kirichenko's avatar
      ddl: add a test case for space:format during snapshot · 35020149
      Georgy Kirichenko authored
      Tarantool must not crash if space:format called twice during snapshot.
      
      Fixes #2336
      35020149
    • Vladimir Davydov's avatar
      vinyl: do not force recovery of vylog · 15207ee6
      Vladimir Davydov authored
      Swallowing errors while reading a vylog file is extremely dangerous,
      because vylog files contain metadata layout. Any error in vylog might
      result in a data corruption beyond recovery in the future. So we must
      fail recovery/snapshot if we fail to read the current vylog file. If
      this happens, data can still be restored by reading the previous vylog
      file or by recovering vylog using write iterator (the latter is yet to
      be implemented).
      15207ee6
    • Roman Tsisyk's avatar
      xrow: refactor DML request encoding/decoding · b6273924
      Roman Tsisyk authored
      Rename methods to match the common naming scheme.
      
      Follow up #2619 and #2507
      b6273924
Loading