Skip to content
Snippets Groups Projects
  1. Mar 01, 2018
    • Konstantin Osipov's avatar
    • Vladimir Davydov's avatar
      vinyl: remove unused error injection handling in cache · 91f5e938
      Vladimir Davydov authored
      ERRINJ_VY_READ_PAGE and ERRINJ_VY_READ_PAGE_TIMEOUT injections are
      used by vinyl/errinj test to check that a page read error is handled
      properly. The cache checks if these injections are enabled and bails
      out if so. Since commit a31c2c10 ("vinyl: force read view in
      iterator in autocommit mode"), this is not necessary, because cache
      is not used unless SELECT is called from a transaction, and the above
      mentioned test doesn't use transactions. So let's remove the checks.
      If we ever enable cache for all SELECTs, we can disable cache in the
      test with box.cfg.vinyl_cache instead of using error injections.
      91f5e938
    • Vladimir Davydov's avatar
      vinyl: don't populate cache if box.cfg.vinyl_cache is 0 · 06081d66
      Vladimir Davydov authored
      Currently, new entries are added to the cache even if the limit is set
      to 0, which is obviously incorrect. Fix it. This might be useful for
      debugging and/or performance evaluation.
      
      Closes #3172
      06081d66
    • Vladimir Davydov's avatar
      vinyl: allow to resize cache online · cad39b52
      Vladimir Davydov authored
      Make box.cfg.vinyl_cache option dynamically configured. If the new
      value is less than the current cache usage, it will block until it
      reclaims enough cache entries to fit in the new limit.
      cad39b52
    • Konstantin Osipov's avatar
    • Vladimir Davydov's avatar
      vinyl: abort worker threads on shutdown · 1dcb011a
      Vladimir Davydov authored
      If the user terminates tarantool while compaction is in progress,
      tarantool won't exit immediately - it will hang until all dump and
      compaction tasks that are currently in progress are complete, which
      may take quite a while on large data sets. What is especially funny,
      once a task has been finished, vinyl will not commit the produced run
      file in the vylog, because the event loop has already been stopped,
      and so will delete it after restart and schedule the task anew.
      
      This patch makes the scheduler forcefully abort all running tasks
      as soon as possible.
      
      Closes #3166
      1dcb011a
    • Vladimir Davydov's avatar
      vinyl: don't start event loop for worker threads · 8cd06e6a
      Vladimir Davydov authored
      This is pointless as worker threads don't use coio.
      8cd06e6a
    • Vladislav Shpilevoy's avatar
      vinyl: introduce vy_run_writer · 2b7efc1e
      Vladislav Shpilevoy authored
      vy_run_writer incapsulates logic of writing statements to a run.
      It provides API to write statements one by one. It is needed so
      that we can abort a run writing task before waiting for it to
      finish writing the file.
      
      Edited by @locker:
       - add region_truncate() wherever necessary
       - do not reallocate row index ibuf for each page
       - remove vy_run_write(), use vy_run_writer directly instead
      
      Needed for #3166
      2b7efc1e
  2. Feb 28, 2018
    • Georgy Kirichenko's avatar
      Send relay heartbeat if wal changes won't be send · 195d4462
      Georgy Kirichenko authored
      If a replica receives some changes then corresponding wal events are
      generated and relay fiber is waken up before heartbeat timeout.
      But there may be nothing to send if all changes are from the current
      relay peer. In this case an applier doesn't receive anything and break a
      connection.
      
      Fixes #3160
      195d4462
  3. Feb 26, 2018
    • Konstantin Osipov's avatar
      box.slab.info(): report total arena memory in arena_size · 64faad37
      Konstantin Osipov authored
      Add memory occupied by cached slabs to the size reported by
      arena_size and arena_used_ratio respectively.
      
      This should make memory monitoring easier:
      
      if items_used_ratio > 0.9 and arena_used_ratio > 0.9 and quota_used_ratio > 0.9 then
          we run out of memory
      end
      64faad37
  4. Feb 25, 2018
    • Konstantin Belyavskiy's avatar
      Fix linking with iconv under FreeBSD · 16a636f2
      Konstantin Belyavskiy authored
      On FreeBSD we have either system iconv (part of libc) or the one
      in /usr/local. The first one is not fully compatible with Linux/
      OSX iconv and both adds specific prefixes to function names.
      So to use them via Lua FFI mechanism, specific names are required.
      Proposal fix:
      Under FreeBSD link with /usr/local/lib/libiconv.so and add prefix.
      
      Closes gh-3073.
      16a636f2
  5. Feb 22, 2018
  6. Feb 21, 2018
  7. Feb 20, 2018
    • Vladislav Shpilevoy's avatar
      Fix build · bdf22bac
      Vladislav Shpilevoy authored
      bdf22bac
    • imarkov's avatar
      http: Add cookie parser · 96cf99f5
      imarkov authored
      * Add parser of cookies from 'Set-Cookie' header.
      * All cookies are stored in response object in cookie table.
      * The format of each table element is following:
      resp[key] = {value, {option, ...}},
      where key, value is cookie key, value
      options are array of strings, set-cookie header options,
      e.g. HttpOnly, Expires=<date>.
      
      Closes #2801
      96cf99f5
    • Ilya's avatar
      http: adapt nginx http headers parser · 094a95e5
      Ilya authored
      * delete old small parser with nginx tested one
      * functionality is not changed
      094a95e5
    • Vladislav Shpilevoy's avatar
      test: vinyl secondary idx iterator skips changes of read keys · f92473f3
      Vladislav Shpilevoy authored
      If a key is updated after a secondary index scan, but before a
      primary index lookup, then ignore this update.
      
      Closes #2442
      f92473f3
    • Vladislav Shpilevoy's avatar
      tuple: allow to do not specify tail nullable index columns · f909b656
      Vladislav Shpilevoy authored
      If a column is nullable and is the last defined one (via index parts
      or space format), it can be omited on insertion. Such absent fields
      are treated as NULLs in comparators and are not stored.
      
      Closes #2988
      f909b656
    • Vladislav Shpilevoy's avatar
      tuple: remove 'is_sequential_nullable_tuples' from key_compare · 8e3bc600
      Vladislav Shpilevoy authored
      This template parameter serves to detect, if two sequences of
      key parts are actually parts of tuples. In such a case
      key_compare_parts does additional comparison by primary key parts,
      if a NULL was met.
      
      This parameters is actually a crutch, put by me to avoid code
      doubling in tuple_compare_sequential_nullable. And this parameter
      complicates #2988, where a sequential nullable tuple contains
      optional parts.
      
      Needed for #2988
      8e3bc600
    • Vladislav Shpilevoy's avatar
      tuple: check key for sequential parts on compile time · feff7e31
      Vladislav Shpilevoy authored
      Closes #2048
      feff7e31
    • Vladislav Shpilevoy's avatar
      Move tuple_compare wrappers to key_def.h/.cc · bde4c789
      Vladislav Shpilevoy authored
      They have no sense without key_def.h.
      bde4c789
    • Vladislav Shpilevoy's avatar
      330852f9
    • Konstantin Osipov's avatar
      alter: a follow up on the fix for gh-3008 · f24facdc
      Konstantin Osipov authored
      Update comments and move space_def_check_compatibility to
      space_def.[hc].
      f24facdc
    • Vladislav Shpilevoy's avatar
      schema: allow to define multiple types for one space field · faa76280
      Vladislav Shpilevoy authored
      On a single field two restrictions exist: tuple format and index part.
      
      The proposal is to allow to use different types for different restrictions,
      if these types are compatible. And for tuples validation use the most
      strict type.
      
      For example, one field can be number in space format, unsigned in one index,
      integer in another index and scalar in a third index. Configuration like this
      can be allowed, because all of these types can store unsigned. And unsigned is
      used to validate tuples.
      
      Besides, it allows incremental DDL. For example, now if you want to change a
      type of a field, which is used by several indexes, then it is impossible on
      a non-empty space, even if a new type is less strict than the old one.
      Lets allow this too.
      
      Closes #3008
      faa76280
    • Vladislav Shpilevoy's avatar
      alter: allow to restrict space format of a non-empty space · c0ef6821
      Vladislav Shpilevoy authored
      At first, now if a space is not empty, its format can not be
      restricted by nullability removal, or by restriction of a field type.
      
      The workaround was format removal and reset. Lets allow normal format
      restriction followed by space format checking.
      
      At second, now an index is rebuild on any change of its key definition.
      But there is no sense to rebuild it, if uniqueness is turned off, part
      field numbers and collations are not changed, because it means, that
      only types was restricted or extended. So format checking is enough.
      
      Needed for #3008
      c0ef6821
    • Vladislav Shpilevoy's avatar
      Rename field_type_is_compatible to field_type1_contains_type2 · 5d2614d8
      Vladislav Shpilevoy authored
      Compatibility must be commutative, but this function is not
      commutative. It checks, that one type can store values of another
      type, but not conversely.
      5d2614d8
    • Vladislav Shpilevoy's avatar
      06aa0266
    • Vladimir Davydov's avatar
      vinyl: allow to disable bloom filter for index · 68a5e6df
      Vladimir Davydov authored
      Not all workloads need bloom filters enabled for all indexes. Let's
      allow to disable them on per-index basis by setting bloom_fpr to 1.
      This will allow to save some memory if bloom filters are unused.
      
      Closes #3138
      68a5e6df
    • Vladimir Davydov's avatar
      Check vinyl index options on box cfg and space alter · 632592bf
      Vladimir Davydov authored
      Currently, one can set insane values for most vinyl index options, which
      will most certainly result in a crash (e.g. bloom_fpr = 100). Add some
      sanity checks.
      632592bf
    • Vladimir Davydov's avatar
      replication: fix rebootstrap race that results in broken subscription · 72ed72a2
      Vladimir Davydov authored
      While a node of the cluster is re-bootstrapping (joining again),
      other nodes may try to re-subscribe to it. They will fail, because
      the rebootstrapped node hasn't tried to subscribe hence hasn't been
      added to the _cluster table yet and so is not present in the hash
      at the subscriber's side for replica_on_applier_reconnect() to look
      it up.
      
      Fix this by making a subscriber create an id-less (REPLICA_ID_NIL)
      struct replica in this case and reattach the applier to it. It will
      be assigned an id when it finally subscribes and is registered in
      _cluster.
      
      Fixes 71b33405 replication: reconnect applier on master rebootstrap
      72ed72a2
    • Vladimir Davydov's avatar
      replication: stop syncing if quorum cannot be formed · 042c07dc
      Vladimir Davydov authored
      If box.cfg() successfully connects to a number of replicas sufficient to
      form a quorum (>= box.cfg.replication_connect_quorum), it won't return
      until it syncs with all of them (lag <= box.cfg.replication_sync_lag).
      If one of the replicas forming a quorum disconnects permanently while
      sync is in progress, box.cfg() will hang forever.
      
      Such a behavior is rather unreasonable. After all, syncing a quorum is
      best-effort. It would be much more sensible to return from box.cfg()
      leaving the instance in the 'orphan' mode in this case. This patch does
      exactly that: now if we detect that not enough replicas are connected to
      form a quorum while we are syncing we stop syncing immediately.
      042c07dc
    • Vladimir Davydov's avatar
      Introduce replication_connect_timeout configuration option · 0e9b87c7
      Vladimir Davydov authored
      Currently, the max time box.cfg() may wait for connection to replicas to
      be established is hardcoded to box.cfg.replication_timeout times 4. As
      a result, users can't revert to pre replication_connect_quorum behavior,
      when box.cfg() blocks until it connects to all replicas. To fix that,
      let's introduce a new configuration option, replication_connect_timeout,
      which determines the replication configuration timeout. By default the
      option is set to 4 seconds.
      
      Closes #3151
      0e9b87c7
    • Vladimir Davydov's avatar
      vinyl: skip needless checks for duplicates on INSERT · 36838c7c
      Vladimir Davydov authored
      If a unique index includes all parts of another unique index, we can
      skip the check for duplicates for it on INSERT. Let's mark all such
      indexes with a special flag on CREATE/ALTER and optimize out the check
      if the flag is set. If there are two indexes that index the same set
      of fields, check uniqueness for the one with a lower id, because it
      is likelier to have have a "warmer" cache.
      
      Closes #3154
      36838c7c
    • Vladimir Davydov's avatar
      vinyl: delete runs compacted during join immediately · 9c446a20
      Vladimir Davydov authored
      We keep run files corresponding to (at least) the last snapshot, because
      we need them for backups and replication. Deletion of compacted run
      files is postponed until the next snapshot. As a consequence, we don't
      delete run files created on a replica during the join stage. However, in
      contrast to run files created during normal operation, these are pure
      garbage and should be deleted right away. Not deleting them can result
      in depletion of disk space, because vinyl has quite high write
      amplification by design.
      
      We can't write a functional test for this, because there's no way to
      guarantee that compaction started during join will finish before join
      completion - if it doesn't, compacted runs won't be removed, because
      they will be assigned to the snapshot created by join.
      
      Closes #3162
      9c446a20
    • Vladislav Shpilevoy's avatar
      vinyl: forbid vinyl index key definition alter · c31dd19a
      Vladislav Shpilevoy authored
      Vinyl index key definition is stored in vylog even if an index is
      empty, and we while do not have a method to update it. So vinyl
      index key definition alter is forbidden even on an empty space.
      
      Closes #3169
      c31dd19a
  8. Feb 19, 2018
  9. Feb 17, 2018
    • Georgy Kirichenko's avatar
      Don't exit from ddl until all other ddls are flushed · 350b645a
      Georgy Kirichenko authored
      If any ddl operation is in progress then all other ddls are
      waiting on schema latch. But after first ddl will be done any
      other request may be issued just after it and commit order will be
      broken in case of multimaster replication.  To prevent this
      behavior any ddl operation should wait until all queued ddls are
      done.
      
      Fixes #2951
      350b645a
    • Georgy Kirichenko's avatar
      Enhance latch behavior · 03fe7a2f
      Georgy Kirichenko authored
      Prevent latch lock interception by other already scheduled or active
      fiber if there is only one waiting. This is needed for strict latch
      ordering.
      03fe7a2f
Loading