1. 22 5月, 2013 1 次提交
    • H
      [RocksDB] Fix PosixLogger and AutoRollLogger thread safety · 839f6db7
      Haobo Xu 提交于
      Summary:
      PosixLogger and AutoRollLogger do not seem to be thread safe.
      For PosixLogger, log_size_ is not atomically updated.
      For AutoRollLogger, the underlying logger_ might be deleted by
      one thread while still being accessed by another.
      
      Test Plan: make check
      
      Reviewers: kailiu, dhruba, heyongqiang
      
      Reviewed By: kailiu
      
      CC: leveldb, zshao, sheki
      
      Differential Revision: https://reviews.facebook.net/D9699
      839f6db7
  2. 21 5月, 2013 1 次提交
  3. 18 5月, 2013 2 次提交
  4. 17 5月, 2013 1 次提交
  5. 16 5月, 2013 1 次提交
    • M
      Enhance the ldb tool to support ttl databases · 8a48410f
      Mayank Agarwal 提交于
      Summary: ldb works with raw data from the database and needs to be aware of ttl-database to work with it meaningfully. '-ttl' option now tells it that. Also added onto the ldb_test.py test. This option may be specified alongwith put, get, scan or dump. There is no support to provide a ttl-value and it uses default forever because there is no use-case for this currently.
      
      Test Plan: make ldb_test; python tools/ldb_test.py
      
      Reviewers: dhruba, sheki, haobo, vamsi
      
      Reviewed By: sheki
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D10797
      8a48410f
  6. 15 5月, 2013 1 次提交
  7. 14 5月, 2013 3 次提交
    • D
      Implemented StringAppendOperator and unit tests. · accd3deb
      Deon Nicholas 提交于
      Summary:
      Implemented the StringAppendOperator class (subclass of MergeOperator).
      Found in utilities/merge_operators/string_append/stringappend.{h,cc}
      
      It is a rocksdb Merge Operator that supports string/list concatenation
       with a configurable delimiter.
      
      The tests are found in .../stringappend_test.cc. It implements a
       map : key -> (list of strings), with core operations Append(list_key,val)
       and Get(list_key).
      
      Test Plan:
      1. Navigate to your rocksdb repository
      2. Execute: make stringappend_test  (to compile)
      3. Execute: ./stringappend_test (to run the tests)
      4. Execute: make all check (to test the ENTIRE rocksdb codebase / regression)
      
      Reviewers: haobo, dhruba, zshao
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D10737
      accd3deb
    • H
      [RocksDB] Cleanup compaction filter to use a class interface, instead of... · 4ca3c67b
      Haobo Xu 提交于
      [RocksDB] Cleanup compaction filter to use a class interface, instead of function pointer and additional context pointer.
      
      Summary:
      This diff replaces compaction_filter_args and CompactionFilter with a single compaction_filter parameter. It gives CompactionFilter better encapsulation and a similar look to Comparator and MergeOpertor, which improves consistency of the overall interface.
      The change is not backward compatible. Nevertheless, the two references in fbcode are not in production yet.
      
      Test Plan: make check
      
      Reviewers: dhruba
      
      Reviewed By: dhruba
      
      CC: leveldb, zshao
      
      Differential Revision: https://reviews.facebook.net/D10773
      4ca3c67b
    • H
      [RocksDB] fix compaction filter trigger condition · 73c0a333
      Haobo Xu 提交于
      Summary:
      Currently, compaction filter is run on internal key older than the oldest snapshot, which is incorrect.
      Compaction filter should really be run on the most recent internal key when there is no external snapshot.
      
      Test Plan: make check; db_stress
      
      Reviewers: dhruba
      
      Reviewed By: dhruba
      
      Differential Revision: https://reviews.facebook.net/D10641
      73c0a333
  8. 11 5月, 2013 3 次提交
  9. 10 5月, 2013 3 次提交
  10. 09 5月, 2013 1 次提交
    • D
      Assertion failure for L0-L1 compactions. · a8d3aa2c
      Dhruba Borthakur 提交于
      Summary:
      For level-0 compactions, we try to find if can include more L0 files
      in the same compaction run. This causes the 'smallest' and 'largest'
      key to get extended to a larger range. But the suceeding call to
      ParentRangeInCompaction() was still using the earlier
      values of 'smallest' and 'largest',
      
      Because of this bug, a file in L1 can be part of two concurrent
      compactions: one L0-L1 compaction and the other L1-L2 compaction.
      
      This should not cause any data loss, but will cause an assertion
      failure with debug builds.
      
      Test Plan: make check
      
      Differential Revision: https://reviews.facebook.net/D10677
      a8d3aa2c
  11. 07 5月, 2013 2 次提交
    • A
      [RocksDB] Clear Archive WAL files · 988c20b9
      Abhishek Kona 提交于
      Summary:
      WAL files are moved to archive directory and clear only at DB::Open.
      Can lead to a lot of space consumption in a Database. Added logic to periodically clear Archive Directory too.
      
      Test Plan: make all check + add unit test
      
      Reviewers: dhruba, heyongqiang
      
      Reviewed By: heyongqiang
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D10617
      988c20b9
    • H
      [RocksDB] fix build · 3c4efc44
      Haobo Xu 提交于
      Summary: makefile change: LIBRARY => LIBOBJECTS
      thanks Abhishek for reproducing this locally.
      
      Test Plan: make release
      
      Reviewers: sheki
      
      CC: leveldb
      
      Task ID: #
      
      Blame Rev:
      3c4efc44
  12. 04 5月, 2013 2 次提交
    • H
      [Rocksdb] Support Merge operation in rocksdb · 05e88540
      Haobo Xu 提交于
      Summary:
      This diff introduces a new Merge operation into rocksdb.
      The purpose of this review is mostly getting feedback from the team (everyone please) on the design.
      
      Please focus on the four files under include/leveldb/, as they spell the client visible interface change.
      include/leveldb/db.h
      include/leveldb/merge_operator.h
      include/leveldb/options.h
      include/leveldb/write_batch.h
      
      Please go over local/my_test.cc carefully, as it is a concerete use case.
      
      Please also review the impelmentation files to see if the straw man implementation makes sense.
      
      Note that, the diff does pass all make check and truly supports forward iterator over db and a version
      of Get that's based on iterator.
      
      Future work:
      - Integration with compaction
      - A raw Get implementation
      
      I am working on a wiki that explains the design and implementation choices, but coding comes
      just naturally and I think it might be a good idea to share the code earlier. The code is
      heavily commented.
      
      Test Plan: run all local tests
      
      Reviewers: dhruba, heyongqiang
      
      Reviewed By: dhruba
      
      CC: leveldb, zshao, sheki, emayanke, MarkCallaghan
      
      Differential Revision: https://reviews.facebook.net/D9651
      05e88540
    • M
      Fix invalid-read to freed memory in ttl-iterator · 37e97b12
      Mayank Agarwal 提交于
      Summary: value function in ttl-iterator was returning string which would have been freed before its usage as a slice. Thanks valgrind!
      
      Test Plan: valgrind ./ttl_test
      
      Reviewers: dhruba, haobo, sheki, vamsi
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D10635
      37e97b12
  13. 03 5月, 2013 1 次提交
    • M
      Timestamp and TTL Wrapper for rocksdb · d786b25e
      Mayank Agarwal 提交于
      Summary:
      When opened with DBTimestamp::Open call, timestamps are prepended to and stripped from the value during subsequent Put and Get calls respectively. The Timestamp is used to discard values in Get and custom compaction filter which have exceeded their TTL which is specified during Open.
      Have made a temporary change to Makefile to let us test with the temporary file TestTime.cc. Have also changed the private members of db_impl.h to protected to let them be inherited by the new class DBTimestamp
      
      Test Plan: make db_timestamp; TestTime.cc(will not check it in) shows how to use the apis currently, but I will write unit-tests shortly
      
      Reviewers: dhruba, vamsi, haobo, sheki, heyongqiang, vkrest
      
      Reviewed By: vamsi
      
      CC: zshao, xjin, vkrest, MarkCallaghan
      
      Differential Revision: https://reviews.facebook.net/D10311
      d786b25e
  14. 30 4月, 2013 2 次提交
  15. 26 4月, 2013 1 次提交
  16. 24 4月, 2013 1 次提交
  17. 23 4月, 2013 5 次提交
    • H
      [RocksDB] Print stack trace to stderr instead of stdio. · 06d3487b
      Haobo Xu 提交于
      Summary: Some scripts (like regression_build_test.sh) redirect stdio to a tmp file and delete it on exit. This would miss the stack trace output on segfault. Output to stderr would hopefully show us the stack trace in the continuous build output.
      
      Test Plan: ./signal_test, make check
      
      Reviewers: dhruba
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D10485
      06d3487b
    • K
      Avoid global static initialization in Env::Default() · 958b9c80
      Kai Liu 提交于
      Summary:
      Mark's task description from #2316777
      
      Env::Default() comes from util/env_posix.cc
      
      This is a static global.
      
      static PosixEnv default_env;
      
      Env* Env::Default() {
        return &default_env;
      }
      
      -----
      
      These globals assume default_env was initialized first. I don't think that is safe or correct to do (http://stackoverflow.com/questions/1005685/c-static-initialization-order)
      
      const string AutoRollLoggerTest::kTestDir(
      test::TmpDir() + "/db_log_test");
      const string AutoRollLoggerTest::kLogFile(
      test::TmpDir() + "/db_log_test/LOG");
      Env* AutoRollLoggerTest::env = Env::Default();
      
      Test Plan:
      run make clean && make && make check
      But how can I know if it works in Ubuntu?
      
      Reviewers: MarkCallaghan, chip
      
      Reviewed By: chip
      
      CC: leveldb, dhruba, haobo
      
      Differential Revision: https://reviews.facebook.net/D10491
      958b9c80
    • H
      [RocksDB] Move table.h to table/ · eb6d1396
      Haobo Xu 提交于
      Summary:
      - don't see a point exposing table.h to the public.
      - fixed make clean to remove also *.d files.
      
      Test Plan: make check; db_stress
      
      Reviewers: dhruba, heyongqiang
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D10479
      eb6d1396
    • A
      [RocksDB] Fix ReadMissing in db_bench · 344e832f
      Abhishek Kona 提交于
      Summary: D8943 Broke read_missing. Fix it by adding a "." at the end of the generated key
      
      Test Plan: generate, print and check the key has a "."
      
      Reviewers: dhruba, haobo
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D10455
      344e832f
    • D
      Initialize parameters in the constructor. · 3cb7bf81
      Dhruba Borthakur 提交于
      Summary:
      RocksDB doesn't build on Ubuntu VM .. shoudl be fixed with this patch.
      
      g++ --version
      g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
      
      util/env_posix.cc:68:24: sorry, unimplemented: non-static data member initializers
      util/env_posix.cc:68:24: error: ISO C++ forbids in-class initialization of non-const static member ‘use_os_buffer’
      util/env_posix.cc:113:24: sorry, unimplemented: non-static data member initializers
      util/env_posix.cc:113:24: error: ISO C++ forbids in-class initialization of non-const static member ‘use_os_buffer
      
      Test Plan: make check
      
      Reviewers: sheki, leveldb
      
      Reviewed By: sheki
      
      Differential Revision: https://reviews.facebook.net/D10461
      3cb7bf81
  18. 21 4月, 2013 4 次提交
    • H
      [RocksDB] CompactionFilter cleanup · b4243e5a
      Haobo Xu 提交于
      Summary:
      - removed the compaction_filter_value from the callback interface. Restrict compaction filter to purging values.
      - modify some comments to reflect curent status.
      
      Test Plan: make check
      
      Reviewers: dhruba
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D10335
      b4243e5a
    • M
      Add --writes_per_second rate limit, print p99.99 in histogram · b1ff9ac9
      Mark Callaghan 提交于
      Summary:
      Adds the --writes_per_second rate limit for the readwhilewriting test.
      The purpose is to optionally avoid saturating storage with writes & compaction
      and test read response time when some writes are being done.
      
      Changes the histogram code to also print the p99.99 value
      
      Task ID: #
      
      Blame Rev:
      
      Test Plan:
      make check, ran db_bench with it
      
      Revert Plan:
      
      Database Impact:
      
      Memcache Impact:
      
      Other Notes:
      
      EImportant:
      
      - begin *PUBLIC* platform impact section -
      Bugzilla: #
      - end platform impact -
      
      Reviewers: haobo
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D10305
      b1ff9ac9
    • H
      [RocksDB] fix build · e0b60923
      Haobo Xu 提交于
      Summary: forgot to include signal_test.cc
      
      Test Plan: make check
      
      Reviewers: sheki
      
      Reviewed By: sheki
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D10281
      e0b60923
    • H
      [RocksDB] Add stacktrace signal handler · 1255dcd4
      Haobo Xu 提交于
      Summary:
      This diff provides the ability to print out a stacktrace when the process receives certain signals.
      Currently, we enable this for the following signals (program error related):
      SIGILL SIGSEGV SIGBUS SIGABRT
      Application simply #include "util/stack_trace.h" and call leveldb::InstallStackTraceHandler() during initialization, if signal handler is needed. It's not done automatically when openning db, because it's the application(process)'s responsibility to install signal handler and some applications might already have their own (like fbcode).
      
      Sample output:
      Received signal 11 (Segmentation fault)
      #0  0x408ff0 ./signal_test() [0x408ff0] /home/haobo/rocksdb/util/signal_test.cc:4
      #1  0x40827d ./signal_test() [0x40827d] /home/haobo/rocksdb/util/signal_test.cc:24
      #2  0x7f8bb183172e /usr/local/fbcode/gcc-4.7.1-glibc-2.14.1/lib/libc.so.6(__libc_start_main+0x10e) [0x7f8bb183172e] ??:0
      #3  0x408ebc ./signal_test() [0x408ebc] /home/engshare/third-party/src/glibc/glibc-2.14.1/glibc-2.14.1/csu/../sysdeps/x86_64/elf/start.S:113
      Segmentation fault (core dumped)
      
      For each frame, we print the raw pointer, the symbol provided by backtrace_symbols (still not good enough), and the source file/line. Note that address translation is done by directly shell out to addr2line. ??:0 means addr2line fails to do the translation. Hacky, but I think it's good for now.
      
      Test Plan: signal_test.cc
      
      Reviewers: dhruba, MarkCallaghan
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D10173
      1255dcd4
  19. 16 4月, 2013 3 次提交
  20. 13 4月, 2013 1 次提交
    • H
      [RocksDB] [Performance] Speed up FindObsoleteFiles · 013e9ebb
      Haobo Xu 提交于
      Summary:
      FindObsoleteFiles was slow, holding the single big lock, resulted in bad p99 behavior.
      Didn't profile anything, but several things could be improved:
      1. VersionSet::AddLiveFiles works with std::set, which is by itself slow (a tree).
         You also don't know how many dynamic allocations occur just for building up this tree.
         switched to std::vector, also added logic to pre-calculate total size and do just one allocation
      2. Don't see why env_->GetChildren() needs to be mutex proteced, moved to PurgeObsoleteFiles where
         mutex could be unlocked.
      3. switched std::set to std:unordered_set, the conversion from vector is also inside PurgeObsoleteFiles
      I have a feeling this should pretty much fix it.
      
      Test Plan: make check;  db_stress
      
      Reviewers: dhruba, heyongqiang, MarkCallaghan
      
      Reviewed By: dhruba
      
      CC: leveldb, zshao
      
      Differential Revision: https://reviews.facebook.net/D10197
      013e9ebb
  21. 12 4月, 2013 1 次提交