1. 02 7月, 2015 1 次提交
    • D
      Windows Port from Microsoft · 18285c1e
      Dmitri Smirnov 提交于
       Summary: Make RocksDb build and run on Windows to be functionally
       complete and performant. All existing test cases run with no
       regressions. Performance numbers are in the pull-request.
      
       Test plan: make all of the existing unit tests pass, obtain perf numbers.
      
       Co-authored-by: Praveen Rao praveensinghrao@outlook.com
       Co-authored-by: Sherlock Huang baihan.huang@gmail.com
       Co-authored-by: Alex Zinoviev alexander.zinoviev@me.com
       Co-authored-by: Dmitri Smirnov dmitrism@microsoft.com
      18285c1e
  2. 20 6月, 2015 2 次提交
  3. 19 6月, 2015 3 次提交
    • Y
      Block geodb_test in ROCKSDB_LITE · 4d6d4768
      Yueh-Hsuan Chiang 提交于
      Summary:
      Block geodb_test in ROCKSDB_LITE as geodb is not supported
      in ROCKSDB_LITE
      
      Test Plan: geodb_test
      
      Reviewers: sdong, rven, anthony, kradhakrishnan, IslamAbdelRahman, igor
      
      Reviewed By: igor
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D40335
      4d6d4768
    • Y
      Block utilities/write_batch_with_index in ROCKSDB_LITE · eade498b
      Yueh-Hsuan Chiang 提交于
      Summary:
      Block utilities/write_batch_with_index in ROCKSDB_LITE as we
      don't include anly utilities in ROCKSDB_LITE
      
      Test Plan: write_batch_with_index_test
      
      Reviewers: rven, anthony, kradhakrishnan, IslamAbdelRahman, igor, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D40347
      eade498b
    • I
      Fail DB::Open() when the requested compression is not available · 760e9a94
      Igor Canadi 提交于
      Summary:
      Currently RocksDB silently ignores this issue and doesn't compress the data. Based on discussion, we agree that this is pretty bad because it can cause confusion for our users.
      
      This patch fails DB::Open() if we don't support the compression that is specified in the options.
      
      Test Plan: make check with LZ4 not present. If Snappy is not present all tests will just fail because Snappy is our default library. We should make Snappy the requirement, since without it our default DB::Open() fails.
      
      Reviewers: sdong, MarkCallaghan, rven, yhchiang
      
      Reviewed By: yhchiang
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D39687
      760e9a94
  4. 18 6月, 2015 1 次提交
    • I
      Use CompactRangeOptions for CompactRange · 12e030a9
      Islam AbdelRahman 提交于
      Summary:
      This diff update DB::CompactRange to use RangeCompactionOptions instead of using multiple parameters
      Old CompactRange is still available but deprecated
      
      Test Plan:
      make all check
      make rocksdbjava
      USE_CLANG=1 make all
      OPT=-DROCKSDB_LITE make release
      
      Reviewers: sdong, yhchiang, igor
      
      Reviewed By: igor
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D40209
      12e030a9
  5. 11 6月, 2015 4 次提交
    • I
      Re-generate WriteEntry on WBWIIterator::Entry() · 821cff11
      Igor Canadi 提交于
      Summary:
      [This is the resubmit of D39813. Tests were failing, so I reverted the diff. I found the bug and I'm now resubmitting]
      
      If we don't do this, any calls to Entry() after WBWI mutation will result in undefined behavior. We need to re-fetch the offset from the skip list and regenerate the new pointer (because string's base pointer can change while mutating).
      
      Test Plan: COMPILE_WITH_ASAN=1 make write_batch_with_index_test && ./write_batch_with_index_test
      
      Reviewers: sdong
      
      Reviewed By: sdong
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D39897
      821cff11
    • I
      Revert "Fix compile" · 75222d13
      Igor Canadi 提交于
      This reverts commit 51440f83.
      
      Revert "Re-generate WriteEntry on WBWIIterator::Entry()"
      
      This reverts commit 4949ef08.
      75222d13
    • I
      Fix compile · 51440f83
      Igor Canadi 提交于
      Summary: Ooops, sorry about this.
      
      Test Plan: compiles
      
      Reviewers: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D39885
      51440f83
    • I
      Re-generate WriteEntry on WBWIIterator::Entry() · 4949ef08
      Igor Canadi 提交于
      Summary: If we don't do this, any calls to Entry() after WBWI mutation will result in undefined behavior. We need to re-fetch the offset from the skip list and regenerate the new pointer (because string's base pointer can change while mutating).
      
      Test Plan: COMPILE_WITH_ASAN=1 make write_batch_with_index_test && ./write_batch_with_index_test
      
      Reviewers: sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D39813
      4949ef08
  6. 10 6月, 2015 2 次提交
    • S
      Make "make all" work for CYGWIN · e409d3d7
      sdong 提交于
      Summary: Some test and benchmark codes don't build for CYGWIN. Fix it.
      
      Test Plan: Build "make all" with TARGET_OS=Cygwin on cygwin and make sure it passes.
      
      Reviewers: rven, yhchiang, anthony, igor, kradhakrishnan
      
      Reviewed By: igor, kradhakrishnan
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D39711
      e409d3d7
    • I
      Add test for iteration+mutation of WBWI · 62c3a957
      Igor Canadi 提交于
      Summary: We should support use-cases that mutate WBWI while they're iterating it. This diff adds a unit test to check this behavior.
      
      Test Plan: this is a test
      
      Reviewers: sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D39501
      62c3a957
  7. 09 6月, 2015 2 次提交
    • I
      Use nullptr for default compaction_filter_factory · 643bbbf0
      Islam AbdelRahman 提交于
      Summary:
      Replacing the default value for compaction_filter_factory and compaction_filter_factory_v2 to be nullptr instead of DefaultCompactionFilterFactory / DefaultCompactionFilterFactoryV2
      The reason for this is to be able to determine easily if we have compaction filter factory or not without depending on RTTI
      
      Test Plan: make check
      
      Reviewers: yoshinorim, ott, igor, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D39693
      643bbbf0
    • S
      Fix CYGWin release build · 21f2492a
      sdong 提交于
      Summary: Change from one std::to_string() to ToString() for Cygwin build
      
      Test Plan: Build it under cygwin
      
      Reviewers: rven, anthony, IslamAbdelRahman, igor, kradhakrishnan
      
      Reviewed By: igor, kradhakrishnan
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D39657
      21f2492a
  8. 03 6月, 2015 1 次提交
  9. 02 6月, 2015 1 次提交
  10. 31 5月, 2015 1 次提交
  11. 30 5月, 2015 1 次提交
    • A
      Optimistic Transactions · dc9d70de
      agiardullo 提交于
      Summary: Optimistic transactions supporting begin/commit/rollback semantics.  Currently relies on checking the memtable to determine if there are any collisions at commit time.  Not yet implemented would be a way of enuring the memtable has some minimum amount of history so that we won't fail to commit when the memtable is empty.  You should probably start with transaction.h to get an overview of what is currently supported.
      
      Test Plan: Added a new test, but still need to look into stress testing.
      
      Reviewers: yhchiang, igor, rven, sdong
      
      Reviewed By: sdong
      
      Subscribers: adamretter, MarkCallaghan, leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D33435
      dc9d70de
  12. 12 5月, 2015 1 次提交
    • A
      API to fetch from both a WriteBatchWithIndex and the db · 711465cc
      agiardullo 提交于
      Summary:
      Added a couple functions to WriteBatchWithIndex to make it easier to query the value of a key including reading pending writes from a batch.  (This is needed for transactions).
      
      I created write_batch_with_index_internal.h to use to store an internal-only helper function since there wasn't a good place in the existing class hierarchy to store this function (and it didn't seem right to stick this function inside WriteBatchInternal::Rep).
      
      Since I needed to access the WriteBatchEntryComparator, I moved some helper classes from write_batch_with_index.cc into write_batch_with_index_internal.h/.cc.  WriteBatchIndexEntry, ReadableWriteBatch, and WriteBatchEntryComparator are all unchanged (just moved to a different file(s)).
      
      Test Plan: Added new unit tests.
      
      Reviewers: rven, yhchiang, sdong, igor
      
      Reviewed By: igor
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D38037
      711465cc
  13. 08 5月, 2015 1 次提交
    • I
      Fix BackupEngine · 50eab9cf
      Igor Canadi 提交于
      Summary:
      In D28521 we removed GarbageCollect() from BackupEngine's constructor. The reason was that opening BackupEngine on HDFS was very slow and in most cases we didn't have any garbage. We allowed the user to call GarbageCollect() when it detects some garbage files in his backup directory.
      
      Unfortunately, this left us vulnerable to an interesting issue. Let's say we started a backup and copied files {1, 3} but the backup failed. On another host, we restore DB from backup and generate {1, 3, 5}. Since {1, 3} is already there, we will not overwrite. However, these files might be from a different database so their contents might be different. See internal task t6781803 for more info.
      
      Now, when we're copying files and we discover a file already there, we check:
      1. if the file is not referenced from any backups, we overwrite the file.
      2. if the file is referenced from other backups AND the checksums don't match, we fail the backup. This will only happen if user is using a single backup directory for backing up two different databases.
      3. if the file is referenced from other backups AND the checksums match, it's all good. We skip the copy and go copy the next file.
      
      Test Plan: Added new test to backupable_db_test. The test fails before this patch.
      
      Reviewers: sdong, rven, yhchiang
      
      Reviewed By: yhchiang
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D37599
      50eab9cf
  14. 06 5月, 2015 1 次提交
  15. 25 4月, 2015 1 次提交
  16. 24 4月, 2015 1 次提交
    • S
      Build for CYGWIN · 98a44559
      sdong 提交于
      Summary:
      Make it build for CYGWIN.
      Need to define "-std=gnu++11" instead of "-std=c++11" and use some replacement functions.
      
      Test Plan: Build it and run some unit tests in CYGWIN
      
      Reviewers: yhchiang, rven, anthony, kradhakrishnan, igor
      
      Reviewed By: igor
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D37605
      98a44559
  17. 18 4月, 2015 1 次提交
    • J
      maint: use ASSERT_TRUE, not ASSERT_EQ(true; same for false · acf8a414
      Jim Meyering 提交于
      Summary:
      The usage I'm fixing here caused trouble on Fedora 21 when
      compiling with the current gcc version 4.9.2 20150212 (Red Hat 4.9.2-6) (GCC):
      
        db/write_controller_test.cc: In member function ‘virtual void rocksdb::WriteControllerTest_SanityTest_Test::TestBody()’:
        db/write_controller_test.cc:23:165: error: converting ‘false’ to pointer type for argument 1 of ‘char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)’ [-Werror=conversion-null]
           ASSERT_EQ(false, controller.IsStopped());
                                                                                                                                                                                ^
      
      This change was induced mechanically via:
      
        git grep -l -E 'ASSERT_EQ\(false'|xargs perl -pi -e 's/ASSERT_EQ\(false, /ASSERT_FALSE(/'
        git grep -l -E 'ASSERT_EQ\(true'|xargs perl -pi -e 's/ASSERT_EQ\(true, /ASSERT_TRUE(/'
      
      Except for the three in utilities/backupable/backupable_db_test.cc for which
      I ended up reformatting (joining lines) in the result.
      
      As for why this problem is exhibited with that version of gcc, and none
      of the others I've used (from 4.8.1 through gcc-5.0.0 and newer), I suspect
      it's a bug in F21's gcc that has been fixed in gcc-5.0.0.
      
      Test Plan:
        "make" now succeed on Fedora 21
      
      Reviewers: ljin, rven, igor.sugak, yhchiang, sdong, igor
      
      Reviewed By: igor
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D37329
      acf8a414
  18. 08 4月, 2015 1 次提交
  19. 07 4月, 2015 1 次提交
    • Y
      Adding another NewFlashcacheAwareEnv function to support pre-opened fd · 824e6463
      Yoshinori Matsunobu 提交于
      Summary:
      There are some cases when flachcache file descriptor was
      already allocated (i.e. fb-MySQL). Then NewFlashcacheAwareEnv returns an
      error at open() because fd was already assigned. This diff adds another
      function to instantiate FlashcacheAwareEnv, with pre-allocated fd cachedev_fd.
      
      Test Plan: Tested with MyRocks using this function, then worked
      
      Reviewers: sdong, igor
      
      Reviewed By: igor
      
      Subscribers: dhruba, MarkCallaghan, rven
      
      Differential Revision: https://reviews.facebook.net/D36447
      824e6463
  20. 02 4月, 2015 1 次提交
  21. 31 3月, 2015 2 次提交
  22. 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
  23. 18 3月, 2015 2 次提交
    • A
      Create an abstract interface for write batches · 81345b90
      agiardullo 提交于
      Summary: WriteBatch and WriteBatchWithIndex now both inherit from a common abstract base class.  This makes it easier to write code that is agnostic toward the implementation of the particular write batch.  In particular, I plan on utilizing this abstraction to allow transactions to support using either implementation of a write batch.
      
      Test Plan: modified existing WriteBatchWithIndex tests to test new functions.  Running all tests.
      
      Reviewers: igor, rven, yhchiang, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D34017
      81345b90
    • I
      rocksdb: switch to gtest · b4b69e4f
      Igor Sugak 提交于
      Summary:
      Our existing test notation is very similar to what is used in gtest. It makes it easy to adopt what is different.
      In this diff I modify existing [[ https://code.google.com/p/googletest/wiki/Primer#Test_Fixtures:_Using_the_Same_Data_Configuration_for_Multiple_Te | test fixture ]] classes to inherit from `testing::Test`. Also for unit tests that use fixture class, `TEST` is replaced with `TEST_F` as required in gtest.
      
      There are several custom `main` functions in our existing tests. To make this transition easier, I modify all `main` functions to fallow gtest notation. But eventually we can remove them and use implementation of `main` that gtest provides.
      
      ```lang=bash
      % cat ~/transform
      #!/bin/sh
      files=$(git ls-files '*test\.cc')
      for file in $files
      do
        if grep -q "rocksdb::test::RunAllTests()" $file
        then
          if grep -Eq '^class \w+Test {' $file
          then
            perl -pi -e 's/^(class \w+Test) {/${1}: public testing::Test {/g' $file
            perl -pi -e 's/^(TEST)/${1}_F/g' $file
          fi
          perl -pi -e 's/(int main.*\{)/${1}::testing::InitGoogleTest(&argc, argv);/g' $file
          perl -pi -e 's/rocksdb::test::RunAllTests/RUN_ALL_TESTS/g' $file
        fi
      done
      % sh ~/transform
      % make format
      ```
      
      Second iteration of this diff contains only scripted changes.
      
      Third iteration contains manual changes to fix last errors and make it compilable.
      
      Test Plan:
      Build and notice no errors.
      ```lang=bash
      % USE_CLANG=1 make check -j55
      ```
      Tests are still testing.
      
      Reviewers: meyering, sdong, rven, igor
      
      Reviewed By: igor
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D35157
      b4b69e4f
  24. 17 3月, 2015 3 次提交
    • V
      Remove unused parameter in CancelAllBackgroundWork · 98c37fda
      Venkatesh Radhakrishnan 提交于
      Summary: Some suggestions for cleanup from Igor.
      
      Test Plan: Regression tests.
      
      Reviewers: igor
      
      Reviewed By: igor
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D35169
      98c37fda
    • I
      rocksdb: Replace ASSERT* with EXPECT* in functions that does not return void value · 9fd6edf8
      Igor Sugak 提交于
      Summary:
      gtest does not use exceptions to fail a unit test by design, and `ASSERT*`s are implemented using `return`. As a consequence we cannot use `ASSERT*` in a function that does not return `void` value ([[ https://code.google.com/p/googletest/wiki/AdvancedGuide#Assertion_Placement | 1]]), and have to fix our existing code. This diff does this in a generic way, with no manual changes.
      
      In order to detect all existing `ASSERT*` that are used in functions that doesn't return void value, I change the code to generate compile errors for such cases.
      
      In `util/testharness.h` I defined `EXPECT*` assertions, the same way as `ASSERT*`, and redefined `ASSERT*` to return `void`. Then executed:
      
      ```lang=bash
      % USE_CLANG=1 make all -j55 -k 2> build.log
      % perl -naF: -e 'print "-- -number=".$F[1]." ".$F[0]."\n" if  /: error:/' \
      build.log | xargs -L 1 perl -spi -e 's/ASSERT/EXPECT/g if $. == $number'
      % make format
      ```
      After that I reverted back change to `ASSERT*` in `util/testharness.h`. But preserved introduced `EXPECT*`, which is the same as `ASSERT*`. This will be deleted once switched to gtest.
      
      This diff is independent and contains manual changes only in `util/testharness.h`.
      
      Test Plan:
      Make sure all tests are passing.
      ```lang=bash
      % USE_CLANG=1 make check
      ```
      
      Reviewers: igor, lgalanis, sdong, yufei.zhu, rven, meyering
      
      Reviewed By: meyering
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D33333
      9fd6edf8
    • I
      rocksdb: Small refactoring before migrating to gtest · 95344346
      Igor Sugak 提交于
      Summary: These changes are necessary to make tests look more generic, and avoid feature conflicts with gtest.
      
      Test Plan:
      Make sure no build errors, and all test are passing.
      ```
      % make check
      ```
      
      Reviewers: igor, meyering
      
      Reviewed By: meyering
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D35145
      95344346
  25. 12 3月, 2015 1 次提交
  26. 28 2月, 2015 2 次提交
    • I
      Fix compile · 216a9e16
      Igor Canadi 提交于
      Summary: I was pretty sure I compiled this before landing, sorry :/
      
      Test Plan: compiles
      
      Reviewers: sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D34173
      216a9e16
    • I
      Fix a bug in ReadOnlyBackupEngine · b9ff6b05
      Igor Canadi 提交于
      Summary:
      This diff fixes a bug introduced by D28521. Read-only backup engine can delete a backup that is later than the latest -- we never check the condition.
      
      I also added a bunch of logging that will help with debugging cases like this in the future.
      
      See more discussion at t6218248.
      
      Test Plan: Added a unit test that was failing before the change. Also, see new LOG file contents: https://phabricator.fb.com/P19738984
      
      Reviewers: benj, sanketh, sumeet, yhchiang, rven, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D33897
      b9ff6b05
  27. 27 2月, 2015 1 次提交
    • I
      Fix compile · a9f0e2b5
      Igor Canadi 提交于
      Summary: as title, we have unused variables. this is a short-term solution
      
      Test Plan: compiles
      
      Reviewers: IslamAbdelRahman, sdong, rven
      
      Reviewed By: rven
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D34125
      a9f0e2b5