1. 13 Nov, 2018 1 commit
    • Yanqin Jin's avatar
      Remove redundant member var and set options (#4631) · 05dec0c7
      Yanqin Jin authored
      In the past, both `DBImpl::atomic_flush_` and
      `DBImpl::immutable_db_options_.atomic_flush` exist. However, we fail to set
      `immutable_db_options_.atomic_flush`, but use `DBImpl::atomic_flush_` which is
      set correctly. This does not lead to incorrect behavior, but is a duplicate of
      Since `immutable_db_options_` is always there and has `atomic_flush`, we should
      use it as source of truth and remove `DBImpl::atomic_flush_`.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/4631
      Differential Revision: D12928371
      Pulled By: riversand963
      fbshipit-source-id: f85a811959d3828aad4a3a1b05f71facf19c636d
  2. 31 Oct, 2018 1 commit
  3. 27 Oct, 2018 1 commit
  4. 10 Oct, 2018 1 commit
  5. 22 Mar, 2018 1 commit
  6. 10 Feb, 2018 1 commit
  7. 18 Jan, 2018 1 commit
    • Andrew Kryczka's avatar
      fix live WALs purged while file deletions disabled · 46e599fc
      Andrew Kryczka authored
      When calling `DisableFileDeletions` followed by `GetSortedWalFiles`, we guarantee the files returned by the latter call won't be deleted until after file deletions are re-enabled. However, `GetSortedWalFiles` didn't omit files already planned for deletion via `PurgeObsoleteFiles`, so the guarantee could be broken.
      We fix it by making `GetSortedWalFiles` wait for the number of pending purges to hit zero if file deletions are disabled. This condition is eventually met since `PurgeObsoleteFiles` is guaranteed to be called for the existing pending purges, and new purges cannot be scheduled while file deletions are disabled. Once the condition is met, `GetSortedWalFiles` simply returns the content of DB and archive directories, which nobody can delete (except for deletion scheduler, for which I plan to fix this bug later) until deletions are re-enabled.
      Closes https://github.com/facebook/rocksdb/pull/3341
      Differential Revision: D6681131
      Pulled By: ajkr
      fbshipit-source-id: 90b1e2f2362ea9ef715623841c0826611a817634
  8. 19 Jul, 2017 1 commit
  9. 16 Jul, 2017 1 commit
  10. 28 Apr, 2017 1 commit
  11. 04 Apr, 2017 1 commit
  12. 16 Mar, 2017 1 commit
    • Islam AbdelRahman's avatar
      Add macros to include file name and line number during Logging · e1916368
      Islam AbdelRahman authored
      current logging
      2017/03/14-14:20:30.393432 7fedde9f5700 (Original Log Time 2017/03/14-14:20:30.393414) [default] Level summary: base level 1 max bytes base 268435456 files[1 0 0 0 0 0 0] max score 0.25
      2017/03/14-14:20:30.393438 7fedde9f5700 [JOB 2] Try to delete WAL files size 61417909, prev total WAL file size 73820858, number of live WAL files 2.
      2017/03/14-14:20:30.393464 7fedde9f5700 [DEBUG] [JOB 2] Delete /dev/shm/old_logging//MANIFEST-000001 type=3 #1 -- OK
      2017/03/14-14:20:30.393472 7fedde9f5700 [DEBUG] [JOB 2] Delete /dev/shm/old_logging//000003.log type=0 #3 -- OK
      2017/03/14-14:20:31.427103 7fedd49f1700 [default] New memtable created with log file: #9. Immutable memtables: 0.
      2017/03/14-14:20:31.427179 7fedde9f5700 [JOB 3] Syncing log #6
      2017/03/14-14:20:31.427190 7fedde9f5700 (Original Log Time 2017/03/14-14:20:31.427170) Calling FlushMemTableToOutputFile with column family [default], flush slots available 1, compaction slots allowed 1, compaction slots scheduled 1
      Closes https://github.com/facebook/rocksdb/pull/1990
      Differential Revision: D4708695
      Pulled By: IslamAbdelRahman
      fbshipit-source-id: cb8968f
  13. 10 Dec, 2016 1 commit
  14. 24 Sep, 2016 1 commit
    • Yi Wu's avatar
      Split DBOptions into ImmutableDBOptions and MutableDBOptions · 9ed928e7
      Yi Wu authored
      Summary: Use ImmutableDBOptions/MutableDBOptions internally and DBOptions only for user-facing APIs. MutableDBOptions is barely a placeholder for now. I'll start to move options to MutableDBOptions in following diffs.
      Test Plan:
        make all check
      Reviewers: yhchiang, IslamAbdelRahman, sdong
      Reviewed By: sdong
      Subscribers: andrewkr, dhruba, leveldb
      Differential Revision: https://reviews.facebook.net/D64065
  15. 10 Jun, 2016 1 commit
    • Wanning Jiang's avatar
      Backup Options · 56887f6c
      Wanning Jiang authored
      Summary: Backup options file to private directory
      Test Plan:
      backupable_db_test.cc, BackupOptions
      	   Modify DB options by calling OpenDB for 3 times. Check the latest options file is in the right place. Also check no redundent files are backuped.
      Reviewers: andrewkr
      Reviewed By: andrewkr
      Subscribers: leveldb, dhruba, andrewkr
      Differential Revision: https://reviews.facebook.net/D59373
  16. 10 Feb, 2016 1 commit
  17. 20 Jun, 2015 1 commit
    • Venkatesh Radhakrishnan's avatar
      Add wal files to Checkpoint for multiple column families. · 04251e1e
      Venkatesh Radhakrishnan authored
      When there are multiple column families, the flush in
      GetLiveFiles is not atomic, so that there are entries in the wal files
      which are needed to get a consisten RocksDB. We now add the log files to
      the checkpoint.
      Test Plan:
      CheckpointCF - This test forces more data to be written to
      the other column families after the flush of the first column family but
      before the second.
      Reviewers: igor, yhchiang, IslamAbdelRahman, anthony, kradhakrishnan, sdong
      Reviewed By: sdong
      Subscribers: dhruba, leveldb
      Differential Revision: https://reviews.facebook.net/D40323
  18. 20 Mar, 2015 1 commit
    • Igor Canadi's avatar
      Don't delete files when column family is dropped · b088c83e
      Igor Canadi authored
      To understand the bug read t5943287 and check out the new test in column_family_test (ReadDroppedColumnFamily), iter 0.
      RocksDB contract allowes you to read a drop column family as long as there is a live reference. However, since our iteration ignores dropped column families, AddLiveFiles() didn't mark files of a dropped column families as live. So we deleted them.
      In this patch I no longer ignore dropped column families in the iteration. I think this behavior was confusing and it also led to this bug. Now if an iterator client wants to ignore dropped column families, he needs to do it explicitly.
      Test Plan: Added a new unit test that is failing on master. Unit test succeeds now.
      Reviewers: sdong, rven, yhchiang
      Reviewed By: yhchiang
      Subscribers: dhruba, leveldb
      Differential Revision: https://reviews.facebook.net/D32535
  19. 13 Feb, 2015 1 commit
    • Igor Canadi's avatar
      Introduce job_id for flush and compaction · e7ea51a8
      Igor Canadi authored
      It would be good to assing background job their IDs. Two benefits:
      1) makes LOGs more readable
      2) I might use it in my EventLogger, which will try to make our LOG easier to read/query/visualize
      Test Plan: ran rocksdb, read the LOG
      Reviewers: sdong, rven, yhchiang
      Reviewed By: yhchiang
      Subscribers: dhruba, leveldb
      Differential Revision: https://reviews.facebook.net/D31617
  20. 05 Feb, 2015 1 commit
    • Yueh-Hsuan Chiang's avatar
      Add a counter for collecting the wait time on db mutex. · 181191a1
      Yueh-Hsuan Chiang authored
      Add a counter for collecting the wait time on db mutex.
      Also add MutexWrapper and CondVarWrapper for measuring wait time.
      Test Plan:
      export ROCKSDB_TESTS=MutexWaitStats
      verify stats output using db_bench
      make clean
      make release
      ./db_bench --statistics=1 --benchmarks=fillseq,readwhilewriting --num=10000 --threads=10
      Sample output:
          rocksdb.db.mutex.wait.micros COUNT : 7546866
      Reviewers: MarkCallaghan, rven, sdong, igor
      Reviewed By: igor
      Subscribers: dhruba, leveldb
      Differential Revision: https://reviews.facebook.net/D32787
  21. 21 Nov, 2014 1 commit
  22. 15 Nov, 2014 3 commits
  23. 05 Nov, 2014 1 commit
  24. 30 Oct, 2014 2 commits
    • Igor Canadi's avatar
      WalManager · 63590548
      Igor Canadi authored
      Summary: Decoupling code that deals with archived log files outside of DBImpl. That will make this code easier to reason about and test. It will also make the code easier to improve, because an improver doesn't have to understand DBImpl code in entirety.
      Test Plan: added test
      Reviewers: ljin, yhchiang, rven, sdong
      Reviewed By: sdong
      Subscribers: dhruba, leveldb
      Differential Revision: https://reviews.facebook.net/D27873
    • Yueh-Hsuan Chiang's avatar
      Apply InfoLogLevel to the logs in db/db_filesnapshot.cc · 7b3a618f
      Yueh-Hsuan Chiang authored
      Summary: Apply InfoLogLevel to the logs in db/db_filesnapshot.cc
      Test Plan: make
      Reviewers: ljin, sdong, rven, igor
      Reviewed By: igor
      Subscribers: dhruba, leveldb
      Differential Revision: https://reviews.facebook.net/D27813
  25. 29 Oct, 2014 1 commit
    • Igor Canadi's avatar
      FlushProcess · a39e931e
      Igor Canadi authored
      Abstract out FlushProcess and take it out of DBImpl.
      This also includes taking DeletionState outside of DBImpl.
      Currently this diff is only doing the refactoring. Future work includes:
      1. Decoupling flush_process.cc, make it depend on less state
      2. Write flush_process_test, which will mock out everything that FlushProcess depends on and test it in isolation
      Test Plan: make check
      Reviewers: rven, yhchiang, sdong, ljin
      Reviewed By: ljin
      Subscribers: dhruba, leveldb
      Differential Revision: https://reviews.facebook.net/D27561
  26. 06 Sep, 2014 1 commit
  27. 05 Sep, 2014 1 commit
  28. 27 Aug, 2014 1 commit
  29. 03 Jul, 2014 1 commit
  30. 21 May, 2014 1 commit
  31. 16 Apr, 2014 1 commit
    • Igor Canadi's avatar
      RocksDBLite · 588bca20
      Igor Canadi authored
      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
  32. 08 Apr, 2014 1 commit
  33. 04 Apr, 2014 1 commit
  34. 03 Apr, 2014 1 commit
    • Haobo Xu's avatar
      [RocksDB] Fix a race condition in GetSortedWalFiles · 48bc0c6a
      Haobo Xu authored
      Summary: This patch fixed a race condition where a log file is moved to archived dir in the middle of GetSortedWalFiles. Without the fix, the log file would be missed in the result, which leads to transaction log iterator gap. A test utility SyncPoint is added to help reproducing the race condition.
      Test Plan: TransactionLogIteratorRace; make check
      Reviewers: dhruba, ljin
      Reviewed By: dhruba
      CC: leveldb
      Differential Revision: https://reviews.facebook.net/D17121
  35. 26 Feb, 2014 1 commit
    • Igor Canadi's avatar
      [CF] Adaptation of GetLiveFiles for CF · dc277f0a
      Igor Canadi authored
      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
  36. 15 Feb, 2014 1 commit
    • Igor Canadi's avatar
      [CF] DB test to run on non-default column family · c67d48c8
      Igor Canadi authored
      This is a huge diff and it was hectic, but the idea is actually quite simple. Every operation (Put, Get, etc.) done on default column family in DBTest is now forwarded to non-default ("pikachu"). The good news is that we had zero test failures! Column families look stable so far.
      One interesting test that I adapted for column families is MultiThreadedTest. I replaced every Put() with a WriteBatch writing to all column families concurrently. Every Put in the write batch contains unique_id. Instead of Get() I do a multiget across all column families with the same key. If atomicity holds, I expect to see the same unique_id in all column families.
      Test Plan: This is a test!
      Reviewers: dhruba, haobo, kailiu, sdong
      CC: leveldb
      Differential Revision: https://reviews.facebook.net/D16149
  37. 13 Feb, 2014 1 commit
    • Igor Canadi's avatar
      [CF] Rethinking ColumnFamilyHandle and fix to dropping column families · b06840aa
      Igor Canadi authored
      The change to the public behavior:
      * When opening a DB or creating new column family client gets a ColumnFamilyHandle.
      * As long as column family handle is alive, client can do whatever he wants with it, even drop it
      * Dropped column family can still be read from (using the column family handle)
      * Added a new call CloseColumnFamily(). Client has to close all column families that he has opened before deleting the DB
      * As soon as column family is closed, any calls to DB using that column family handle will fail (also any outstanding calls)
      * Ref-counting ColumnFamilyData
      * New thread-safety for ColumnFamilySet
      * Dropped column families are now completely dropped and their memory cleaned-up
      Test Plan: added some tests to column_family_test
      Reviewers: dhruba, haobo, kailiu, sdong
      CC: leveldb
      Differential Revision: https://reviews.facebook.net/D16101