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. 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
  3. 25 4月, 2015 1 次提交
  4. 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
  5. 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
  6. 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
  7. 30 1月, 2015 1 次提交
  8. 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
  9. 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
  10. 05 1月, 2015 1 次提交
  11. 04 1月, 2015 2 次提交
  12. 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
  13. 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
  14. 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
  15. 05 9月, 2014 1 次提交
  16. 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
  17. 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
  18. 21 5月, 2014 1 次提交
  19. 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
  20. 27 4月, 2014 1 次提交
  21. 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
  22. 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
  23. 25 3月, 2014 1 次提交
  24. 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
  25. 11 3月, 2014 2 次提交
  26. 05 3月, 2014 1 次提交
    • I
      Some fixes to BackupableDB · e3f396f1
      Igor Canadi 提交于
      Summary:
      (1) Report corruption if backup meta file has tailing data that was not read. This should fix: https://github.com/facebook/rocksdb/issues/81 (also, @sdong reported similar issue)
      (2) Don't use OS buffer when copying file to backup directory. We don't need the file in cache since we won't be reading it twice
      (3) Don't delete newer backups when somebody tries to backup the diverged DB (restore from older backup, add new data, try to backup). Rather, just fail the new backup.
      
      Test Plan: backupable_db_test
      
      Reviewers: ljin, dhruba, sdong
      
      Reviewed By: ljin
      
      CC: leveldb, sdong
      
      Differential Revision: https://reviews.facebook.net/D16287
      e3f396f1
  27. 26 2月, 2014 1 次提交
    • I
      [CF] Adaptation of GetLiveFiles for CF · dc277f0a
      Igor Canadi 提交于
      Summary: Even if user flushes the memtables before getting live files, we still can't guarantee that new data didn't come in (to already-flushed memtables). If we want backups to provide consistent view of the database, we still need to get WAL files.
      
      Test Plan: backupable_db_test
      
      Reviewers: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D16299
      dc277f0a
  28. 13 2月, 2014 1 次提交
    • L
      IOError cleanup · 994c327b
      Lei Jin 提交于
      Summary: Clean up IOErrors so that it only indicates errors talking to device.
      
      Test Plan: make all check
      
      Reviewers: igor, haobo, dhruba, emayanke
      
      Reviewed By: igor
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D15831
      994c327b
  29. 29 1月, 2014 3 次提交
    • I
      Better interface to create BackupEngine · e5ec7384
      Igor Canadi 提交于
      Summary: I think it looks nicer. In RocksDB we have both styles, but I think that static method is the more common version.
      
      Test Plan: backupable_db_test
      
      Reviewers: ljin, benj, swk
      
      Reviewed By: ljin
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D15519
      e5ec7384
    • I
      Export BackupEngine · ec2fa4a6
      Igor Canadi 提交于
      Summary:
      Lots of clients have problems with using StackableDB interface. It's nice to have BackupableDB as a layer on top of DB, but not necessary.
      
      This diff exports BackupEngine, which can be used to create backups without forcing clients to use StackableDB interface.
      
      Test Plan: backupable_db_test
      
      Reviewers: dhruba, ljin, swk
      
      Reviewed By: ljin
      
      CC: leveldb, benj
      
      Differential Revision: https://reviews.facebook.net/D15477
      ec2fa4a6
    • L
      add checksum for backup files · 9dc29414
      Lei Jin 提交于
      Summary: Keep checksum of each backuped file in meta file. When it restores these files, compute their checksum on the fly and compare against what is in the meta file. Fail the restore process if checksum mismatch.
      
      Test Plan: unit test
      
      Reviewers: haobo, igor, sdong, kailiu
      
      Reviewed By: igor
      
      CC: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D15381
      9dc29414
  30. 25 1月, 2014 1 次提交
  31. 11 1月, 2014 1 次提交
  32. 10 1月, 2014 1 次提交
    • I
      Feature requests for BackupableDB · cb37ddf2
      Igor Canadi 提交于
      Summary:
      This diff introduces some features that were requested by two internal customers:
      * Ability for backups not to share table files, because we can't guarantee that equal filename means equal content accross replicas
      * Ability for two threads to call EnableFileDeletions() and DisableFileDeletions()
      * Ability to stop backup from another thread and not slow down the DB close
      * Copy the files to the temporary folder first and then atomically rename
      
      Test Plan: Added some tests to backupable_db_test
      
      Reviewers: dhruba, sanketh, muthu, sdong, haobo
      
      Reviewed By: haobo
      
      CC: leveldb, sanketh, muthu
      
      Differential Revision: https://reviews.facebook.net/D14769
      cb37ddf2
  33. 13 12月, 2013 2 次提交