1. 03 6月, 2014 5 次提交
    • S
      In DB::NewIterator(), try to allocate the whole iterator tree in an arena · df9069d2
      sdong 提交于
      Summary:
      In this patch, try to allocate the whole iterator tree starting from DBIter from an arena
      1. ArenaWrappedDBIter is created when serves as the entry point of an iterator tree, with an arena in it.
      2. Add an option to create iterator from arena for following iterators: DBIter, MergingIterator, MemtableIterator, all mem table's iterators, all table reader's iterators and two level iterator.
      3. MergeIteratorBuilder is created to incrementally build the tree of internal iterators. It is passed to mem table list and version set and add iterators to it.
      
      Limitations:
      (1) Only DB::NewIterator() without tailing uses the arena. Other cases, including readonly DB and compactions are still from malloc
      (2) Two level iterator itself is allocated in arena, but not iterators inside it.
      
      Test Plan: make all check
      
      Reviewers: ljin, haobo
      
      Reviewed By: haobo
      
      Subscribers: leveldb, dhruba, yhchiang, igor
      
      Differential Revision: https://reviews.facebook.net/D18513
      df9069d2
    • S
      dynamic_bloom: replace some divide (remainder) operations with shifts in... · 46279669
      sdong 提交于
      dynamic_bloom: replace some divide (remainder) operations with shifts in locality mode, and other improvements
      
      Summary:
      This patch changes meaning of options.bloom_locality: 0 means disable cache line optimization and any positive number means use CACHE_LINE_SIZE as block size (the previous behavior is the block size will be CACHE_LINE_SIZE*options.bloom_locality). By doing it, the divide operations inside a block can be replaced by a shift.
      
      Performance is improved:
      https://reviews.facebook.net/P471
      
      Also, improve the basic algorithm in two ways:
      (1) make sure num of blocks is an odd number
      (2) rotate bytes after every probe in locality mode. Since the divider is 2^n, unless doing it, we are never able to use all the bits.
      Improvements of false positive: https://reviews.facebook.net/P459
      
      Test Plan: make all check
      
      Reviewers: ljin, haobo
      
      Reviewed By: haobo
      
      Subscribers: dhruba, yhchiang, igor, leveldb
      
      Differential Revision: https://reviews.facebook.net/D18843
      46279669
    • I
      Only signal cond variable if need to · 91ddd587
      Igor Canadi 提交于
      Summary:
      At the end of BackgroundCallCompaction(), we call SignalAll(), even though we don't need to. If compaction hasn't done anything and there's another compaction running, there is no need to signal on the condition variable. Doing so creates a tight feedback loop which results in log files like:
      
         wait for memtable flush
         compaction nothing to do
         wait for memtable flush
         compaction nothing to do
      
      This change eliminates that
      
      Test Plan:
      make check
      Also:
      
          icanadi@dev1440 ~ $ grep "nothing to do" /fast-rocksdb-tmp/rocksdb_test/column_family_test/LOG | wc -l
          7435
          icanadi@dev1440 ~ $ grep "nothing to do" /fast-rocksdb-tmp/rocksdb_test/column_family_test/LOG | wc -l
          372
      
      First version is before the change, second version is after the change.
      
      Reviewers: dhruba, ljin, haobo, yhchiang, sdong
      
      Reviewed By: sdong
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D18855
      91ddd587
    • I
      Flush stale column families less aggressively · 8cb7ad83
      Igor Canadi 提交于
      Summary:
      We've seen some production issues where column family is detected as stale, although there is only one column family in the system. This is a quick fix that:
      1) doesn't flush stale column families if there's only one of them
      2) Use 4 as a coefficient instead of 2 for determening when a column family is stale. This will make flushing less aggressive, while still keep a nice dynamic flushing of very stale CFs.
      
      Test Plan: make check
      
      Reviewers: dhruba, haobo, ljin, sdong
      
      Reviewed By: sdong
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D18861
      8cb7ad83
    • S
      db_stress to add an option to periodically change background thread pool size. · 593bb2c4
      sdong 提交于
      Summary: Add an option to indicates the variation of background threads. If the flag is not 0, for every 100 milliseconds, adjust thread pool size to a value within the range.
      
      Test Plan: run db_stress
      
      Reviewers: haobo, dhruba, igor, ljin
      
      Reviewed By: ljin
      
      Subscribers: leveldb, nkg-
      
      Differential Revision: https://reviews.facebook.net/D18759
      593bb2c4
  2. 31 5月, 2014 2 次提交
    • L
      forward iterator · 388d2054
      Lei Jin 提交于
      Summary:
      Forward iterator puts everything together in a flat structure instead of
      a hierarchy of nested iterators. this should simplify the code and
      provide better performance. It also enables more optimization since all
      information are accessiable in one place.
      Init evaluation shows about 6% improvement
      
      Test Plan: db_test and db_bench
      
      Reviewers: dhruba, igor, tnovak, sdong, haobo
      
      Reviewed By: haobo
      
      Subscribers: sdong, leveldb
      
      Differential Revision: https://reviews.facebook.net/D18795
      388d2054
    • L
      add an iterator refresh option for SeekRandom · f29c62fc
      Lei Jin 提交于
      Summary: One more option to allow iterator refreshing when using normal iterator
      
      Test Plan: ran db_bench
      
      Reviewers: haobo, sdong, igor
      
      Reviewed By: igor
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D18849
      f29c62fc
  3. 30 5月, 2014 1 次提交
  4. 29 5月, 2014 1 次提交
    • Y
      [Java] Generalize dis-own native handle and refine dispose framework. · ab3e5666
      Yueh-Hsuan Chiang 提交于
      Summary:
      1. Move disOwnNativeHandle() function from RocksDB to RocksObject
      to allow other RocksObject to use disOwnNativeHandle() when its
      ownership of native handle has been transferred.
      
      2. RocksObject now has an abstract implementation of dispose(),
      which does the following two things.  First, it checks whether
      both isOwningNativeHandle() and isInitialized() return true.
      If so, it will call the protected abstract function dispose0(),
      which all the subclasses of RocksObject should implement.  Second,
      it sets nativeHandle_ = 0.  This redesign ensure all subclasses
      of RocksObject have the same dispose behavior.
      
      3. All subclasses of RocksObject now should implement dispose0()
      instead of dispose(), and dispose0() will be called only when
      isInitialized() returns true.
      
      Test Plan:
      make rocksdbjava
      make jtest
      
      Reviewers: dhruba, sdong, ankgup87, rsumbaly, swapnilghike, zzbennett, haobo
      
      Reviewed By: haobo
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D18801
      ab3e5666
  5. 28 5月, 2014 3 次提交
  6. 24 5月, 2014 1 次提交
  7. 23 5月, 2014 1 次提交
  8. 22 5月, 2014 6 次提交
  9. 21 5月, 2014 5 次提交
  10. 20 5月, 2014 2 次提交
    • S
      Print out thread ID while thread terminates for decreased pool size. · bd1105aa
      sdong 提交于
      Summary: Per request from @nkg-, temporarily print thread ID when a thread terminates. It is a temp solution as we try to minimized stderr messages.
      
      Test Plan: env_test
      
      Reviewers: haobo, igor, dhruba
      
      Reviewed By: igor
      
      CC: nkg-, leveldb
      
      Differential Revision: https://reviews.facebook.net/D18753
      bd1105aa
    • S
      ThreadPool to allow decrease number of threads and increase of number of... · 3df07d17
      sdong 提交于
      ThreadPool to allow decrease number of threads and increase of number of threads is to be instantly scheduled
      
      Summary:
      Add a feature to decrease the number of threads in thread pool.
      Also instantly schedule more threads if number of threads is increased.
      
      Here is the way it is implemented: each background thread needs its thread ID. After decreasing number of threads, all threads are woken up. The thread with the largest thread ID will terminate. If there are more threads to terminate, the thread will wake up all threads again.
      
      Another change is made so that when number of threads is increased, more threads are created and all previous excessive threads are woken up to do the work.
      
      Test Plan: Add a unit test.
      
      Reviewers: haobo, dhruba
      
      Reviewed By: haobo
      
      CC: yhchiang, igor, nkg-, leveldb
      
      Differential Revision: https://reviews.facebook.net/D18675
      3df07d17
  11. 17 5月, 2014 1 次提交
  12. 16 5月, 2014 4 次提交
  13. 15 5月, 2014 8 次提交