Skip to content
Snippets Groups Projects
  1. Feb 03, 2017
  2. Feb 02, 2017
    • Konstantin Osipov's avatar
      gh-2046, optimized comparators for sequential keys, review fixes · d8e06100
      Konstantin Osipov authored
      * fix a bug with partial initialization of tuple_format
        in case of zero field count (space with no indexes, we still may
        allocate a tuple for this space, so need an initialized format,
        but will fail to insert it)
      * replace assert() for small field_map_size with an error
        message, introduce a new error code for field count limit,
        i.e. limit on how many fields can participate in indexes
      * renames & comments
      d8e06100
    • Roman Tsisyk's avatar
      Don't store offsets for sequential multi-parts keys · 78102868
      Roman Tsisyk authored
      Optimize tuple format for cases when all keys are sequential and
      start from the first field:
      
          box.schema.space.create('memtx')
          box.space.memtx:create_index('sequential0', { parts =
              { 1, 'unsigned' }})
          box.space.memtx:create_index('sequential1', { parts =
              { 1, 'unsigned', 2, 'unsigned' }})
          box.space.memtx:create_index('sequential2', { parts =
              { 1, 'unsigned', 2, 'unsigned', 3, 'unsigned', 4, 'unsigned' }})
          box.space.memtx:create_index('random1', { parts =
              { 3, 'unsigned' } })
      
      In the example above only field 3 is now indexed by offset (was 2, 3, 4).
      
      + Improve error message in field_type_create()
      
      Closes #2046
      78102868
    • Vladimir Davydov's avatar
      vinyl: metadata log rotation - review fixes · 5472def1
      Vladimir Davydov authored
       - VY_LOG_TX_BUF_SIZE: macro -> enum
       - Fix say_debug() format in vy_log_tx_commit()
       - Cleanup vy_log_flush_f() ret code convention
       - Add a separate function, vy_log_tx_try_commit(), instead of
         passing no_discard=true to vy_log_tx_commit()
       - Refactor 'if' statement in vy_index_drop()
       - Fix comments:
         * vy_log_flush(): why entire buffer is flushed
         * vy_log_open(): mention that we abort recovery if we can't
           flush the log
         * vy_log_tx_commit(): explain why the log can be not open
         * vy_log_tx_commit(): add comment stating that we rollback
           transaction on failure
      5472def1
    • Vladislav Shpilevoy's avatar
      vinyl: fill secondary tuples with nils · 962c50e7
      Vladislav Shpilevoy authored
      Secondary index now store tuples with offsets.
      
      Needed for #1908
      962c50e7
    • Vladislav Shpilevoy's avatar
      vinyl: use space format for result tuples · 8adf0c90
      Vladislav Shpilevoy authored
      Needed for #1908
      8adf0c90
    • Roman Tsisyk's avatar
      vinyl: minor refactoring of vy_stmt_new_XXX() · 0c94df07
      Roman Tsisyk authored
      * Remove unused part_count
      * Unify arguments order
      
      Needed for #1908
      0c94df07
    • Vladimir Davydov's avatar
      vinyl: rotate metadata log on checkpoint · 5be1ea19
      Vladimir Davydov authored
       - Name vinyl metadata log as <lsn>.vymeta, where <lsn> is the last
         snapshot signature.
       - Create a new log on checkpoint, discarding records left from
         dead indexes and records that cancel each other.
       - Log rotation is done asynchronously from a coeio thread so
         as not to stall ongoing transactions.
       - While the log is being rotated, all log writers are locked out.
         This should be OK, because log is rotated fairly quickly and
         the scheduler, which is the primary user of the log, runs rarely.
      
      Closes #2031
      5be1ea19
    • Vladimir Davydov's avatar
      vinyl: log index drop in metadata journal · 2022e017
      Vladimir Davydov authored
      We need to log index drop requests in order to be able to filter out
      dropped indexes from the metadata log on rotation, which is yet to be
      implemented. The problem is that we can't fail vy_index_drop(), because
      index drop request has already been written to WAL by the time it is
      called. We cope with it by writing VY_LOG_DROP_INDEX record with
      @no_discard flag set to true, so that even if vy_log_tx_commit() fails,
      it stays in the buffer and can be flushed along with the next
      transaction. If it isn't flushed before the server is restarted, we
      replay the record in the metadata log buffer on WAL recovery, returning
      to exactly the same condition we had before restart.
      
      While we are at it, rename VY_LOG_NEW_INDEX to VY_LOG_CREATE_INDEX for
      consistency.
      2022e017
    • Vladimir Davydov's avatar
      vinyl: add buffering to metadata log · 3a7df43d
      Vladimir Davydov authored
       - vy_log_write() now simply appends a record to the internal log
         buffer, hence it cannot fail, which simplifies the log API.
       - vy_log_tx_commit() flushes the buffer to xlog. It has a new flag
         @no_discard. If it is set, the buffer won't be reset on failure, so
         that the next transaction will retry to flush the records. Currently,
         it is not used by any caller, but it is required for a drop index
         record, which will be introduced later.
       - vy_log_write() can be used before the log was opened, in which case
         records will be flushed when the log is first opened. This is needed
         for drop records too.
       - vy_log_tx_rollback() is removed as it is not needed any more with
         vy_log_write() never failing.
      3a7df43d
    • Vladimir Davydov's avatar
      vinyl: extract vy_log_open() from vy_log_new() · 7c0a869a
      Vladimir Davydov authored
      In order to implement index drop logging, we will need to be able to use
      vy_log during local recovery when its xlog hasn't been open yet (it is
      open when recovery is complete). So let's extract the code opening xlog
      file from vy_log_new() and put it in a separate function, vy_log_open(),
      to be called after local recovery has completed, while creating vy_log
      from vy_env constructor.
      7c0a869a
    • Vladimir Davydov's avatar
      vinyl: move vy_log struct to header · 50291c46
      Vladimir Davydov authored
      So that we can access next_run_id and next_range_id directly.
      In order not to introduce dependency on latch.h, allocate a latch
      from heap and use forward declaration.
      50291c46
    • Vladimir Davydov's avatar
      vinyl: generate VY_LOG_NEW_INDEX event in vy_recovery_load_index() · 25c93ca5
      Vladimir Davydov authored
      Currently, vy_recovery_load_index() only calls the callback for
      VY_LOG_INSERT_RANGE and VY_LOG_INSERT_RUN types of records, but not
      for VY_LOG_NEW_INDEX, because the latter is not needed during index
      recovery. However, we will need this event for vinyl metadata log
      rotation, so let's make vy_recovery_load_index() call the callback
      for this type of record too.
      25c93ca5
    • Konstantin Osipov's avatar
      wal: log error during wal rotation. · 2587f6a2
      Konstantin Osipov authored
      2587f6a2
    • Vladimir Davydov's avatar
      vinyl: do not check msgpack type in vy_log_record_decode() · a0e7f062
      Vladimir Davydov authored
      Not necessary as log records are checksummed.
      a0e7f062
  3. Feb 01, 2017
  4. Jan 31, 2017
Loading