1. 30 6月, 2015 1 次提交
    • T
      Fix a comparison in DBIter::FindPrevUserKey() · ec70fea4
      Tomislav Novak 提交于
      Summary:
      When seek target is a merge key (`kTypeMerge`), `DBIter::FindNextUserEntry()`
      advances the underlying iterator _past_ the current key (`saved_key_`); see
      `MergeValuesNewToOld()`. However, `FindPrevUserKey()` assumes that `iter_`
      points to an entry with the same user key as `saved_key_`. As a result,
      `it->Seek(key) && it->Prev()` can cause the iterator to be positioned at the
      _next_, instead of the previous, entry (new test, written by @lovro, reproduces
      the bug).
      
      This diff changes `FindPrevUserKey()` to also skip keys that are _greater_ than
      `saved_key_`.
      
      Test Plan: db_test
      
      Reviewers: igor, sdong
      
      Reviewed By: sdong
      
      Subscribers: leveldb, dhruba, lovro
      
      Differential Revision: https://reviews.facebook.net/D40791
      ec70fea4
  2. 26 6月, 2015 1 次提交
  3. 25 4月, 2015 1 次提交
  4. 25 3月, 2015 1 次提交
    • A
      Adding stats for the merge and filter operation · 3d1a924f
      Anurag Indu 提交于
      Summary:
      We have addded new stats and perf_context for measuring the merge and filter operation time consumption.
      We have bounded all the merge operations within the GUARD statment and collected the total time for these operations in the DB.
      
      Test Plan: WIP
      
      Reviewers: rven, yhchiang, kradhakrishnan, igor, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D34377
      3d1a924f
  5. 27 2月, 2015 1 次提交
    • I
      rocksdb: Add missing override · 62247ffa
      Igor Sugak 提交于
      Summary:
      When using latest clang (3.6 or 3.7/trunck) rocksdb is failing with many errors. Almost all of them are missing override errors. This diff adds missing override keyword. No manual changes.
      
      Prerequisites: bear and clang 3.5 build with extra tools
      
      ```lang=bash
      % USE_CLANG=1 bear make all # generate a compilation database http://clang.llvm.org/docs/JSONCompilationDatabase.html
      % clang-modernize -p . -include . -add-override
      % make format
      ```
      
      Test Plan:
      Make sure all tests are passing.
      ```lang=bash
      % #Use default fb code clang.
      % make check
      ```
      Verify less error and no missing override errors.
      ```lang=bash
      % # Have trunk clang present in path.
      % ROCKSDB_NO_FBCODE=1 CC=clang CXX=clang++ make
      ```
      
      Reviewers: igor, kradhakrishnan, rven, meyering, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D34077
      62247ffa
  6. 24 2月, 2015 1 次提交
  7. 05 12月, 2014 1 次提交
  8. 07 11月, 2014 1 次提交
    • I
      Turn -Wshadow back on · 9f20395c
      Igor Canadi 提交于
      Summary: It turns out that -Wshadow has different rules for gcc than clang. Previous commit fixed clang. This commits fixes the rest of the warnings for gcc.
      
      Test Plan: compiles
      
      Reviewers: ljin, yhchiang, rven, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D28131
      9f20395c
  9. 31 10月, 2014 1 次提交
  10. 01 10月, 2014 1 次提交
  11. 09 9月, 2014 1 次提交
  12. 05 9月, 2014 1 次提交
  13. 03 9月, 2014 1 次提交
    • T
      Refactor PerfStepTimer to stop on destruct · 6614a484
      Torrie Fischer 提交于
      This eliminates the need to remember to call PERF_TIMER_STOP when a section has
      been timed. This allows more useful design with the perf timers and enables
      possible return value optimizations. Simplistic example:
      
      class Foo {
        public:
          Foo(int v) : m_v(v);
        private:
          int m_v;
      }
      
      Foo makeFrobbedFoo(int *errno)
      {
        *errno = 0;
        return Foo();
      }
      
      Foo bar(int *errno)
      {
        PERF_TIMER_GUARD(some_timer);
      
        return makeFrobbedFoo(errno);
      }
      
      int main(int argc, char[] argv)
      {
        Foo f;
        int errno;
      
        f = bar(&errno);
      
        if (errno)
          return -1;
        return 0;
      }
      
      After bar() is called, perf_context.some_timer would be incremented as if
      Stop(&perf_context.some_timer) was called at the end, and the compiler is still
      able to produce optimizations on the return value from makeFrobbedFoo() through
      to main().
      6614a484
  14. 14 8月, 2014 1 次提交
  15. 09 8月, 2014 1 次提交
    • S
      Fix db_test and DBIter · 7c88249f
      Stanislau Hlebik 提交于
      Summary: Fix old issue with DBTest.Randomized with BlockBasedTableWithWholeKeyHashIndex + added printing in DBTest.Randomized.
      
      Test Plan: make all check
      
      Reviewers: zagfox, igor, ljin, yhchiang, sdong
      
      Reviewed By: sdong
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D21003
      7c88249f
  16. 29 7月, 2014 1 次提交
    • L
      make statistics forward-able · 40fa8a4c
      Lei Jin 提交于
      Summary:
      Make StatisticsImpl being able to forward stats to provided statistics
      implementation. The main purpose is to allow us to collect internal
      stats in the future even when user supplies custom statistics
      implementation. It avoids intrumenting 2 sets of stats collection code.
      One immediate use case is tuning advisor, which needs to collect some
      internal stats, users may not be interested.
      
      Test Plan:
      ran db_bench and see stats show up at the end of run
      Will run make all check since some tests rely on statistics
      
      Reviewers: yhchiang, sdong, igor
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D20145
      40fa8a4c
  17. 16 7月, 2014 1 次提交
  18. 04 6月, 2014 1 次提交
  19. 03 6月, 2014 1 次提交
    • 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
  20. 31 5月, 2014 1 次提交
    • 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
  21. 10 5月, 2014 1 次提交
  22. 15 4月, 2014 1 次提交
  23. 09 4月, 2014 1 次提交
  24. 08 4月, 2014 1 次提交
    • S
      PlainTableIterator not to store copied key in std::string · 5e2db3b4
      sdong 提交于
      Summary:
      Move PlainTableIterator's copied key from std::string local buffer to avoid paying the extra costs in std::string related to sharing. Reuse the same buffer class in DbIter. Move the class to dbformat.h.
      
      This patch improves iterator performance significantly. Running this benchmark:
      
      ./table_reader_bench --num_keys2=17 --iterator --plain_table --time_unit=nanosecond
      
      The average latency is improved to about 750 nanoseconds from 1100 nanoseconds.
      
      Test Plan:
      Add a unit test.
      make all check
      
      Reviewers: haobo, ljin
      
      Reviewed By: haobo
      
      CC: igor, yhchiang, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D17547
      5e2db3b4
  25. 02 4月, 2014 1 次提交
  26. 25 3月, 2014 1 次提交
    • Y
      Enhance partial merge to support multiple arguments · cda4006e
      Yueh-Hsuan Chiang 提交于
      Summary:
      * PartialMerge api now takes a list of operands instead of two operands.
      * Add min_pertial_merge_operands to Options, indicating the minimum
        number of operands to trigger partial merge.
      * This diff is based on Schalk's previous diff (D14601), but it also
        includes necessary changes such as updating the pure C api for
        partial merge.
      
      Test Plan:
      * make check all
      * develop tests for cases where partial merge takes more than two
        operands.
      
      TODOs (from Schalk):
      * Add test with min_partial_merge_operands > 2.
      * Perform benchmarks to measure the performance improvements (can probably
        use results of task #2837810.)
      * Add description of problem to doc/index.html.
      * Change wiki pages to reflect the interface changes.
      
      Reviewers: haobo, igor, vamsi
      
      Reviewed By: haobo
      
      CC: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D16815
      cda4006e
  27. 18 3月, 2014 1 次提交
    • S
      Fix a bug that Prev() can hang. · c61c9830
      sdong 提交于
      Summary: Prev() now can hang when there is a key with more than max_skipped number of appearance internally but all of them are newer than the sequence ID to seek. Add unit tests to confirm the bug and fix it.
      
      Test Plan: make all check
      
      Reviewers: igor, haobo
      
      Reviewed By: igor
      
      CC: ljin, yhchiang, leveldb
      
      Differential Revision: https://reviews.facebook.net/D16899
      c61c9830
  28. 04 2月, 2014 1 次提交
  29. 09 1月, 2014 1 次提交
    • I
      Add column family information to WAL · 19e3ee64
      Igor Canadi 提交于
      Summary:
      I have added three new value types:
      * kTypeColumnFamilyDeletion
      * kTypeColumnFamilyValue
      * kTypeColumnFamilyMerge
      which include column family Varint32 before the data (value, deletion and merge). These values are used only in WAL (not in memtables yet).
      
      This endeavour required changing some WriteBatch internals.
      
      Test Plan: Added a unittest
      
      Reviewers: dhruba, haobo, sdong, kailiu
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D15045
      19e3ee64
  30. 04 12月, 2013 1 次提交
    • I
      Get rid of some shared_ptrs · 043fc14c
      Igor Canadi 提交于
      Summary:
      I went through all remaining shared_ptrs and removed the ones that I found not-necessary. Only GenerateCachePrefix() is called fairly often, so don't expect much perf wins.
      
      The ones that are left are accessed infrequently and I think we're fine with keeping them.
      
      Test Plan: make asan_check
      
      Reviewers: dhruba, haobo
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D14427
      043fc14c
  31. 26 11月, 2013 1 次提交
  32. 22 11月, 2013 3 次提交
  33. 21 11月, 2013 1 次提交
  34. 18 10月, 2013 1 次提交
    • S
      Fix Bug: iterator.Prev() or iterator.SeekToLast() might return the first... · 65428b0c
      Siying Dong 提交于
      Fix Bug: iterator.Prev() or iterator.SeekToLast() might return the first element instead of the correct one
      
      Summary:
      Recent patch https://reviews.facebook.net/D11865 introduced a regression bug:
      
      DBIter::FindPrevUserEntry(), which is called by DBIter::Prev() (and also implicitly if calling iterator.SeekToLast())  might do issue a seek when having skipped too many entries. If the skipped entry just before the seek() is a delete, the saved key is erased so that it seeks to the front, so Prev() would return the first element.
      
      This patch fixes the bug by not doing seek() in DBIter::FindNextUserEntry() if saved key has been erased.
      
      Test Plan: Add a test DBTest.IterPrevMaxSkip which would fail without the patch and would pass with the change.
      
      Reviewers: dhruba, xjin, haobo
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D13557
      65428b0c
  35. 17 10月, 2013 1 次提交
  36. 05 10月, 2013 1 次提交
  37. 03 10月, 2013 1 次提交
  38. 07 9月, 2013 1 次提交
    • D
      An iterator may automatically invoke reseeks. · 197034e4
      Dhruba Borthakur 提交于
      Summary:
      An iterator invokes reseek if the number of sequential skips over the
      same userkey exceeds a configured number. This makes iter->Next()
      faster (bacause of fewer key compares) if a large number of
      adjacent internal keys in a table (sst or memtable) have the
      same userkey.
      
      Test Plan: Unit test DBTest.IterReseek.
      
      Reviewers: emayanke, haobo, xjin
      
      Reviewed By: xjin
      
      CC: leveldb, xjin
      
      Differential Revision: https://reviews.facebook.net/D11865
      197034e4