1. 26 8月, 2015 1 次提交
  2. 21 7月, 2015 1 次提交
    • A
      Improved FileExists API · 06429408
      agiardullo 提交于
      Summary: Add new CheckFileExists method.  Considered changing the FileExists api but didn't want to break anyone's builds.
      
      Test Plan: unit tests
      
      Reviewers: yhchiang, igor, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D42003
      06429408
  3. 18 7月, 2015 1 次提交
    • S
      Move rate_limiter, write buffering, most perf context instrumentation and most... · 6e9fbeb2
      sdong 提交于
      Move rate_limiter, write buffering, most perf context instrumentation and most random kill out of Env
      
      Summary: We want to keep Env a think layer for better portability. Less platform dependent codes should be moved out of Env. In this patch, I create a wrapper of file readers and writers, and put rate limiting, write buffering, as well as most perf context instrumentation and random kill out of Env. It will make it easier to maintain multiple Env in the future.
      
      Test Plan: Run all existing unit tests.
      
      Reviewers: anthony, kradhakrishnan, IslamAbdelRahman, yhchiang, igor
      
      Reviewed By: igor
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D42321
      6e9fbeb2
  4. 17 7月, 2015 1 次提交
    • D
      Ensure Windows build w/o port/port.h in public headers · d1a45718
      Dmitri Smirnov 提交于
       - Remove make file defines from public headers and use _WIN32 because it is compiler defined
       - use __GNUC__ and __clang__ to guard non-portable attributes
       - add #include "port/port.h" to some new .cc files.
       - minor changes in CMakeLists to reflect recent changes
      d1a45718
  5. 16 7月, 2015 1 次提交
    • D
      Ensure Windows build w/o port/port.h in public headers · 247690fe
      Dmitri Smirnov 提交于
       - Remove make file defines from public headers and use _WIN32 because it is compiler defined
       - use __GNUC__ and __clang__ to guard non-portable attributes
       - add #include "port/port.h" to some new .cc files.
       - minor changes in CMakeLists to reflect recent changes
      247690fe
  6. 15 7月, 2015 1 次提交
    • I
      Better error handling in BackupEngine · 8a9fca26
      Igor Canadi 提交于
      Summary:
      Couple of changes here:
      * NewBackupEngine() and NewReadOnlyBackupEngine() are now removed. They were deprecated since RocksDB 3.8. Changing these to new functions should be pretty straight-forward. As a followup, I'll fix all fbcode callsights
      * Instead of initializing backup engine in the constructor, we initialize it in a separate function now. That way, we can catch all errors and return appropriate status code.
      * We catch all errors during initializations and return them to the client properly.
      * Added new tests to backupable_db_test, to make sure that we can't open BackupEngine when there are Env errors.
      * Transitioned backupable_db_test to use BackupEngine rather than BackupableDB. From the two available APIs, judging by the current use-cases, it looks like BackupEngine API won. It's much more flexible since it doesn't require StackableDB.
      
      Test Plan: Added a new unit test to backupable_db_test
      
      Reviewers: yhchiang, sdong, AaronFeldman
      
      Reviewed By: AaronFeldman
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D41925
      8a9fca26
  7. 14 7月, 2015 1 次提交
    • S
      "make format" against last 10 commits · f9728640
      sdong 提交于
      Summary: This helps Windows port to format their changes, as discussed. Might have formatted some other codes too becasue last 10 commits include more.
      
      Test Plan: Build it.
      
      Reviewers: anthony, IslamAbdelRahman, kradhakrishnan, yhchiang, igor
      
      Reviewed By: igor
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D41961
      f9728640
  8. 08 7月, 2015 1 次提交
  9. 03 7月, 2015 3 次提交
  10. 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
  11. 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
  12. 25 4月, 2015 1 次提交
  13. 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
  14. 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
  15. 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
  16. 30 1月, 2015 1 次提交
  17. 24 1月, 2015 1 次提交
    • I
      Fix ASAN failure with backupable DB · a52dd002
      Igor Canadi 提交于
      Summary: It looks like ASAN with gcc 4.9 works better than 4.8.1. It detected this possibility of heap buffer overflow. This was in our codebase for a year :)
      
      Test Plan: COMPILE_WITH_ASAN=1 make backupable_db && ./backupable_db
      
      Reviewers: yhchiang, rven, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D32085
      a52dd002
  18. 09 1月, 2015 1 次提交
    • R
      Reduce memory footprint in backupable db. · 628a67b0
      Robert 提交于
      * Use emplace when possible.
      * Make FileInfo shared among all BackupMeta, instead of storing filenames.
      * Make checksum_value in FileInfo constant.
      * Reserve space beforehand if container size is known.
      * Make FileInfo and BackupMeta non-copyable and non-assignable to prevent future logic errors.
        It is very dangerous to copy BackupMeta without careful handling refcounts of FileInfo.
      * Remove a copy of BackupMeta when detected corrupt backup.
      628a67b0
  19. 05 1月, 2015 1 次提交
  20. 04 1月, 2015 2 次提交
  21. 14 11月, 2014 1 次提交
    • H
      Improve Backup Engine. · 31b02dc2
      Hasnain Lakhani 提交于
      Summary:
      Improve the backup engine by not deleting the corrupted
      backup when it is detected; instead leaving it to the client
      to delete the corrupted backup.
      
      Also add a BackupEngine::Open() call.
      
      Test Plan:
      Add check to CorruptionTest inside backupable_db_test
      to check that the corrupt backups are not deleted. The previous
      version of the code failed this test as backups were deleted,
      but after the changes in this commit, this test passes.
      
      Run make check to ensure that no other tests fail.
      
      Reviewers: sdong, benj, sanketh, sumeet, igor
      
      Reviewed By: igor
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D28521
      31b02dc2
  22. 12 11月, 2014 1 次提交
    • I
      Turn on -Wshorten-64-to-32 and fix all the errors · 767777c2
      Igor Canadi 提交于
      Summary:
      We need to turn on -Wshorten-64-to-32 for mobile. See D1671432 (internal phabricator) for details.
      
      This diff turns on the warning flag and fixes all the errors. There were also some interesting errors that I might call bugs, especially in plain table. Going forward, I think it makes sense to have this flag turned on and be very very careful when converting 64-bit to 32-bit variables.
      
      Test Plan: compiles
      
      Reviewers: ljin, rven, yhchiang, sdong
      
      Reviewed By: yhchiang
      
      Subscribers: bobbaldwin, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D28689
      767777c2
  23. 10 9月, 2014 2 次提交
    • I
      Fix Mac compile · a52cecb5
      Igor Canadi 提交于
      a52cecb5
    • X
      Added a few statistics for BackupableDB · 6cc12860
      Xiaozheng Tie 提交于
      Summary:
      Added the following statistics to BackupableDB:
      
      1. Number of successful and failed backups in class BackupStatistics
      2. Time taken to do a backup
      3. Number of files in a backup
      
      1 is implemented in the BackupStatistics class
      2 and 3 are added in the BackupMeta and BackupInfo class
      
      Test Plan:
      1 can be tested using BackupStatistics::ToString(),
      2 and 3 can be tested in the BackupInfo class
      
      Reviewers: sdong, igor2, ljin, igor
      
      Reviewed By: igor
      
      Differential Revision: https://reviews.facebook.net/D22785
      6cc12860
  24. 05 9月, 2014 1 次提交
  25. 23 7月, 2014 1 次提交
    • I
      Move include/utilities/*.h to include/rocksdb/utilities/*.h · 0ff183a0
      Igor Canadi 提交于
      Summary:
      All public headers need to be under `include/rocksdb` directory. Otherwise, clients include our header files like this:
      
          #include <rocksdb/db.h>
          #include <utilities/backupable_db.h> // still our public header!
      
      Also, internally, we include:
      
          #include "utilities/backupable/backupable_db.h" // internal header
          #include "utilities/backupable_db.h" // public header
      
      which is confusing.
      
      This way, when we install rocksdb as a system library, we can just copy `include/rocksdb` directory to system's header files. We can't really copy `utilities` directory to system's header files.
      
      Test Plan: compiles
      
      Reviewers: dhruba, ljin, yhchiang, sdong
      
      Reviewed By: sdong
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D20409
      0ff183a0
  26. 09 7月, 2014 1 次提交
    • L
      generic rate limiter · 5ef1ba7f
      Lei Jin 提交于
      Summary:
      A generic rate limiter that can be shared by threads and rocksdb
      instances. Will use this to smooth out write traffic generated by
      compaction and flush. This will help us get better p99 behavior on flash
      storage.
      
      Test Plan:
      unit test output
      ==== Test RateLimiterTest.Rate
      request size [1 - 1023], limit 10 KB/sec, actual rate: 10.374969 KB/sec, elapsed 2002265
      request size [1 - 2047], limit 20 KB/sec, actual rate: 20.771242 KB/sec, elapsed 2002139
      request size [1 - 4095], limit 40 KB/sec, actual rate: 41.285299 KB/sec, elapsed 2202424
      request size [1 - 8191], limit 80 KB/sec, actual rate: 81.371605 KB/sec, elapsed 2402558
      request size [1 - 16383], limit 160 KB/sec, actual rate: 162.541268 KB/sec, elapsed 3303500
      
      Reviewers: yhchiang, igor, sdong
      
      Reviewed By: sdong
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D19359
      5ef1ba7f
  27. 21 5月, 2014 1 次提交
  28. 03 5月, 2014 1 次提交
    • B
      Add share_files_with_cheksum option to BackupEngine · 41e5cf23
      Benjamin Renard 提交于
      Summary: added a new option to BackupEngine: if share_files_with_checksum is set to true, sst files are stored in shared_checksum/ and are identified by the triple (file name, checksum, file size) instead of just the file name. This option is targeted at distributed databases that want to backup their primary replica.
      
      Test Plan: unit tests and tested backup and restore on a distributed rocksdb
      
      Reviewers: igor
      
      Reviewed By: igor
      
      Differential Revision: https://reviews.facebook.net/D18393
      41e5cf23
  29. 27 4月, 2014 1 次提交
  30. 26 4月, 2014 1 次提交
    • I
      Read-only BackupEngine · a618691a
      Igor Canadi 提交于
      Summary: Read-only BackupEngine can connect to the same backup directory that is already running BackupEngine. That enables some interesting use-cases (i.e. restoring replica from primary's backup directory)
      
      Test Plan: added a unit test
      
      Reviewers: dhruba, haobo, ljin
      
      Reviewed By: ljin
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D18297
      a618691a
  31. 16 4月, 2014 1 次提交
    • I
      RocksDBLite · 588bca20
      Igor Canadi 提交于
      Summary:
      Introducing RocksDBLite! Removes all the non-essential features and reduces the binary size. This effort should help our adoption on mobile.
      
      Binary size when compiling for IOS (`TARGET_OS=IOS m static_lib`) is down to 9MB from 15MB (without stripping)
      
      Test Plan: compiles :)
      
      Reviewers: dhruba, haobo, ljin, sdong, yhchiang
      
      Reviewed By: yhchiang
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D17835
      588bca20
  32. 25 3月, 2014 1 次提交
  33. 18 3月, 2014 1 次提交
    • I
      keep_log_files option in BackupableDB · 9caeff51
      Igor Canadi 提交于
      Summary:
      Added an option to BackupableDB implementation that allows users to persist in-memory databases. When the restore happens with keep_log_files = true, it will
      *) Not delete existing log files in wal_dir
      *) Move log files from archive directory to wal_dir, so that DB can replay them if necessary
      
      Test Plan: Added an unit test
      
      Reviewers: dhruba, ljin
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D16941
      9caeff51
  34. 11 3月, 2014 2 次提交