1. 05 12月, 2013 1 次提交
  2. 04 12月, 2013 1 次提交
    • I
      Killing Transform Rep · eb12e47e
      Igor Canadi 提交于
      Summary:
      Let's get rid of TransformRep and it's children. We have confirmed that HashSkipListRep works better with multifeed, so there is no benefit to keeping this around.
      
      This diff is mostly just deleting references to obsoleted functions. I also have a diff for fbcode that we'll need to push when we switch to new release.
      
      I had to expose HashSkipListRepFactory in the client header files because db_impl.cc needs access to GetTransform() function for SanitizeOptions.
      
      Test Plan: make check
      
      Reviewers: dhruba, haobo, kailiu, sdong
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D14397
      eb12e47e
  3. 28 11月, 2013 1 次提交
  4. 26 11月, 2013 2 次提交
  5. 22 11月, 2013 2 次提交
  6. 18 11月, 2013 2 次提交
    • I
      Include <unistd.h> in db_test · fc614282
      Igor Canadi 提交于
      Summary: This is the only compile issue in Ubuntu. It might be better to include <unistd.h> only in env_posix and add Truncate function to Env, but since we use truncate only in db_test, I don't think it makes much sense.
      
      Test Plan: Rocksdb now compiles on Ubuntu!
      
      Reviewers: dhruba, kailiu
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D14127
      fc614282
    • I
      Upgrading compiler to gcc4.8.1 · de9ce7d4
      Igor Canadi 提交于
      Summary:
      Finally did it - the trick was in using --dynamic-linker option. This is first step to running ASAN.
      
      All of our code seems to compile just fine on 4.8.1. However, I still left fbcode.471.sh in the 'build_tools/' just in case.
      
      Test Plan: make clean; make
      
      Reviewers: dhruba, haobo, kailiu, emayanke, sdong
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D14109
      de9ce7d4
  7. 17 11月, 2013 1 次提交
  8. 13 11月, 2013 2 次提交
    • K
      Add the index/filter block cache · 88ba331c
      Kai Liu 提交于
      Summary: This diff leverage the existing block cache and extend it to cache index/filter block.
      
      Test Plan:
      Added new tests in db_test and table_test
      
      The correctness is checked by:
      
      1. make check
      2. make valgrind_check
      
      Performance is test by:
      
      1. 10 times of build_tools/regression_build_test.sh on two versions of rocksdb before/after the code change. Test results suggests no significant difference between them. For the two key operatons `overwrite` and `readrandom`, the average iops are both 20k and ~260k, with very small variance).
      2. db_stress.
      
      Reviewers: dhruba
      
      Reviewed By: dhruba
      
      CC: leveldb, haobo, xjin
      
      Differential Revision: https://reviews.facebook.net/D13167
      88ba331c
    • K
      Fixing the warning messages captured under mac os # Consider using `git commit... · 21587760
      kailiu 提交于
      Fixing the warning messages captured under mac os # Consider using `git commit -m 'One line title' && arc diff`. # You will save time by running lint and unit in the background.
      
      Summary: The work to make sure mac os compiles rocksdb is not completed yet. But at least we can start cleaning some warnings captured only by g++ from mac os..
      
      Test Plan: ran make in mac os
      
      Reviewers: dhruba
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D14049
      21587760
  9. 09 11月, 2013 2 次提交
    • I
      Speed up FindObsoleteFiles · 1510339e
      Igor Canadi 提交于
      Summary:
      Here's one solution we discussed on speeding up FindObsoleteFiles. Keep a set of all files in DBImpl and update the set every time we create a file. I probably missed few other spots where we create a file.
      
      It might speed things up a bit, but makes code uglier. I don't really like it.
      
      Much better approach would be to abstract all file handling to a separate class. Think of it as layer between DBImpl and Env. Having a separate class deal with file namings and deletion would benefit both code cleanliness (especially with huge DBImpl) and speed things up. It will take a huge effort to do this, though.
      
      Let's discuss offline today.
      
      Test Plan: Ran ./db_stress, verified that files are getting deleted
      
      Reviewers: dhruba, haobo, kailiu, emayanke
      
      Reviewed By: dhruba
      
      Differential Revision: https://reviews.facebook.net/D13827
      1510339e
    • I
      Forgot to change interface everywhere · dd218bbc
      Igor Canadi 提交于
      Summary: Changed the name and interface for creating HashSkipListRep. Forgot to change it in db_test.
      
      Test Plan: make db_test
      
      Reviewers: haobo
      
      Reviewed By: haobo
      
      Differential Revision: https://reviews.facebook.net/D13965
      dd218bbc
  10. 07 11月, 2013 2 次提交
  11. 06 11月, 2013 2 次提交
    • D
      Fix failure in rocksdb unit test CompressedCache · 39190588
      Dhruba Borthakur 提交于
      Summary:
      The problem was that there was only a single key-value in a block
      and its compressibility was less than 88%. Rocksdb refuses to
      compress a block unless its compresses to lesser than 88% of its
      original size. If a block is not compressed, it does nto get inserted
      into the compressed block cache.
      
      Create the test data so that multiple records fit into the same
      data block. This increases the compressibility of these data block.
      
      Test Plan: ./db_test
      
      Reviewers: kailiu, haobo
      
      Reviewed By: kailiu
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D13905
      39190588
    • D
      Fixed valgrind error in DBTest.CompressedCache · 7845fd9d
      Dhruba Borthakur 提交于
      Summary:
      Fixed valgrind error in DBTest.CompressedCache.
      This fixes the valgrind error (thanks to Haobo). I am still trying to reproduce the test-failure case deterministically.
      
      Test Plan: db_test
      
      Reviewers: haobo
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D13899
      7845fd9d
  12. 05 11月, 2013 1 次提交
    • M
      Making the transaction log iterator more robust · f837f5b1
      Mayank Agarwal 提交于
      Summary:
      strict essentially means that we MUST find the startsequence. Thus we should return if starteSequence is not found in the first file in case strict is set. This will take care of ending the iterator in case of permanent gaps due to corruptions in the log files
      Also created NextImpl function that will have internal variable to distinguish whether Next is being called from StartSequence or by application.
      Set NotFoudn::gaps status to give an indication of gaps happeneing.
      Polished the inline documentation at various places
      
      Test Plan:
      * db_repl_stress test
      * db_test relating to transaction log iterator
      * fbcode/wormhole/rocksdb/rocks_log_iterator
      * sigma production machine sigmafio032.prn1
      
      Reviewers: dhruba
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D13689
      f837f5b1
  13. 02 11月, 2013 1 次提交
    • D
      Implement a compressed block cache. · b4ad5e89
      Dhruba Borthakur 提交于
      Summary:
      Rocksdb can now support a uncompressed block cache, or a compressed
      block cache or both. Lookups first look for a block in the
      uncompressed cache, if it is not found only then it is looked up
      in the compressed cache. If it is found in the compressed cache,
      then it is uncompressed and inserted into the uncompressed cache.
      
      It is possible that the same block resides in the compressed cache
      as well as the uncompressed cache at the same time. Both caches
      have their own individual LRU policy.
      
      Test Plan: Unit test case attached.
      
      Reviewers: kailiu, sdong, haobo, leveldb
      
      Reviewed By: haobo
      
      CC: xjin, haobo
      
      Differential Revision: https://reviews.facebook.net/D12675
      b4ad5e89
  14. 01 11月, 2013 2 次提交
    • H
      [RocksDB] Add OnCompactionStart to CompactionFilter class · 8cbe5bb5
      Haobo Xu 提交于
      Summary: This is to give application compaction filter a chance to access context information of a specific compaction run. For example, depending on whether a compaction goes through all data files, the application could do things differently.
      
      Test Plan: make check
      
      Reviewers: dhruba, kailiu, sdong
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D13683
      8cbe5bb5
    • N
      In-place updates for equal keys and similar sized values · fe250702
      Naman Gupta 提交于
      Summary:
      Currently for each put, a fresh memory is allocated, and a new entry is added to the memtable with a new sequence number irrespective of whether the key already exists in the memtable. This diff is an attempt to update the value inplace for existing keys. It currently handles a very simple case:
      1. Key already exists in the current memtable. Does not inplace update values in immutable memtable or snapshot
      2. Latest value type is a 'put' ie kTypeValue
      3. New value size is less than existing value, to avoid reallocating memory
      
      TODO: For a put of an existing key, deallocate memory take by values, for other value types till a kTypeValue is found, ie. remove kTypeMerge.
      TODO: Update the transaction log, to allow consistent reload of the memtable.
      
      Test Plan: Added a unit test verifying the inplace update. But some other unit tests broken due to invalid sequence number checks. WIll fix them next.
      
      Reviewers: xinyaohu, sumeet, haobo, dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D12423
      
      Automatic commit by arc
      fe250702
  15. 29 10月, 2013 2 次提交
    • S
      Make "Table" pluggable · d4eec30e
      Siying Dong 提交于
      Summary: This patch makes Table and TableBuilder a abstract class and make all the implementation of the current table into BlockedBasedTable and BlockedBasedTable Builder.
      
      Test Plan: Make db_test.cc to work with block based table. Add a new test simple_table_db_test.cc where a different simple table format is implemented.
      
      Reviewers: dhruba, haobo, kailiu, emayanke, vamsi
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D13521
      d4eec30e
    • I
      If a Put fails, fail all other puts · 100fa8e0
      Igor Canadi 提交于
      Summary:
      When a Put fails, it can leave database in a messy state. We don't want to pretend that everything is OK when it may not be. We fail every write following the failed one.
      
      I added checks for corruption to DBImpl::Write(). Is there anywhere else I need to add them?
      
      Test Plan: Corruption unit test.
      
      Reviewers: dhruba, haobo, kailiu
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D13671
      100fa8e0
  16. 25 10月, 2013 1 次提交
    • M
      Unify DeleteFile and DeleteWalFiles · 56305221
      Mayank Agarwal 提交于
      Summary:
      This is to simplify rocksdb public APIs and improve the code quality.
      Created an additional parameter to ParseFileName for log sub type and improved the code for deleting a wal file.
      Wrote exhaustive unit-tests in delete_file_test
      Unification of other redundant APIs can be taken up in a separate diff
      
      Test Plan: Expanded delete_file test
      
      Reviewers: dhruba, haobo, kailiu, sdong
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D13647
      56305221
  17. 23 10月, 2013 1 次提交
    • M
      Dbid feature · 9b50106f
      Mayank Agarwal 提交于
      Summary:
      Create a new type of file on startup if it doesn't already exist called DBID.
      This will store a unique number generated from boost library's uuid header file.
      The use-case is to identify the case of a db losing all its data and coming back up either empty or from an image(backup/live replica's recovery)
      the key point to note is that DBID is not stored in a backup or db snapshot
      It's preferable to use Boost for uuid because:
      1) A non-standard way of generating uuid is not good
      2) /proc/sys/kernel/random/uuid generates a uuid but only on linux environments and the solution would not be clean
      3) c++ doesn't have any direct way to get a uuid
      4) Boost is a very good library that was already having linkage in rocksdb from third-party
      Note: I had to update the TOOLCHAIN_REV in build files to get latest verison of boost from third-party as the older version had a bug.
      I had to put Wno-uninitialized in Makefile because boost-1.51 has an unitialized variable and rocksdb would not comiple otherwise. Latet open-source for boost is 1.54 but is not there in third-party. I have notified the concerned people in fbcode about it.
      @kailiu : While releasing to third-party, an additional dependency will need to be created for boost in TARGETS file. I can help identify.
      
      Test Plan:
      Expand db_test to test 2 cases
      1) Restarting db with Id file present - verify that no change to Id
      2)Restarting db with Id file deleted - verify that a different Id is there after reopen
      Also run make all check
      
      Reviewers: dhruba, haobo, kailiu, sdong
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D13587
      9b50106f
  18. 18 10月, 2013 2 次提交
    • S
      Fix Bug: iterator.Prev() or iterator.SeekToLast() might return the first... · 65428b0c
      Siying Dong 提交于
      Fix Bug: iterator.Prev() or iterator.SeekToLast() might return the first element instead of the correct one
      
      Summary:
      Recent patch https://reviews.facebook.net/D11865 introduced a regression bug:
      
      DBIter::FindPrevUserEntry(), which is called by DBIter::Prev() (and also implicitly if calling iterator.SeekToLast())  might do issue a seek when having skipped too many entries. If the skipped entry just before the seek() is a delete, the saved key is erased so that it seeks to the front, so Prev() would return the first element.
      
      This patch fixes the bug by not doing seek() in DBIter::FindNextUserEntry() if saved key has been erased.
      
      Test Plan: Add a test DBTest.IterPrevMaxSkip which would fail without the patch and would pass with the change.
      
      Reviewers: dhruba, xjin, haobo
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D13557
      65428b0c
    • S
      Universal Compaction to Have a Size Percentage Threshold To Decide Whether to Compress · 9edda370
      Siying Dong 提交于
      Summary:
      This patch adds a option for universal compaction to allow us to only compress output files if the files compacted previously did not yet reach a specified ratio, to save CPU costs in some cases.
      
      Compression is always skipped for flushing. This is because the size information is not easy to evaluate for flushing case. We can improve it later.
      
      Test Plan:
      add test
      DBTest.UniversalCompactionCompressRatio1 and DBTest.UniversalCompactionCompressRatio12
      
      Reviewers: dhruba, haobo
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D13467
      9edda370
  19. 17 10月, 2013 2 次提交
    • D
      Add appropriate LICENSE and Copyright message. · 9cd22109
      Dhruba Borthakur 提交于
      Summary:
      Add appropriate LICENSE and Copyright message.
      
      Test Plan:
      make check
      
      Reviewers:
      
      CC:
      
      Task ID: #
      
      Blame Rev:
      9cd22109
    • S
      Enable background flush thread by default and fix issues related to it · 073cbfc8
      Siying Dong 提交于
      Summary:
      Enable background flush thread in this patch and fix unit tests with:
      (1) After background flush, schedule a background compaction if condition satisfied;
      (2) Fix a bug that if universal compaction is enabled and number of levels are set to be 0, compaction will not be automatically triggered
      (3) Fix unit tests to wait for compaction to finish instead of flush, before checking the compaction results.
      
      Test Plan: pass all unit tests
      
      Reviewers: haobo, xjin, dhruba
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D13461
      073cbfc8
  20. 15 10月, 2013 2 次提交
    • M
      Features in Transaction log iterator · fe371396
      Mayank Agarwal 提交于
      Summary:
      * Logstore requests a valid change of reutrning an empty iterator and not an error in case of no log files.
      * Changed the code to return the writebatch containing the sequence number requested from GetupdatesSince even if it lies in the middle. Earlier we used to return the next writebatch,. This also allows me oto guarantee that no files played upon by the iterator are redundant. I mean the starting log file has at least a sequence number >= the sequence number requested form GetupdatesSince.
      * Cleaned up redundant logic in Iterator::Next and made a new function SeekToStartSequence for greater readability and maintainibilty.
      * Modified a test in db_test accordingly
      Please check the logic carefully and suggest improvements. I have a separate patch out for more improvements like restricting reader to read till written sequences.
      
      Test Plan:
      * transaction log iterator tests in db_test,
      * db_repl_stress.
      * rocks_log_iterator_test in fbcode/wormhole/rocksdb/test - 2 tests thriving on hacks till now can get simplified
      * testing on the shadow setup for sigma with replication
      
      Reviewers: dhruba, haobo, kailiu, sdong
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D13437
      fe371396
    • S
      Change Function names from Compaction->Flush When they really mean Flush · 88f2f890
      Siying Dong 提交于
      Summary: When I debug the unit test failures when enabling background flush thread, I feel the function names can be made clearer for people to understand. Also, if the names are fixed, in many places, some tests' bugs are obvious (and some of those tests are failing). This patch is to clean it up for future maintenance.
      
      Test Plan: Run test suites.
      
      Reviewers: haobo, dhruba, xjin
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D13431
      88f2f890
  21. 11 10月, 2013 1 次提交
  22. 09 10月, 2013 2 次提交
    • N
      Add option for storing transaction logs in a separate dir · cbf4a064
      Naman Gupta 提交于
      Summary: In some cases, you might not want to store the data log (write ahead log) files in the same dir as the sst files. An example use case is leaf, which stores sst files in tmpfs. And would like to save the log files in a separate dir (disk) to save memory.
      
      Test Plan: make all. Ran db_test test. A few test failing. P2785018. If you guys don't see an obvious problem with the code, maybe somebody from the rocksdb team could help me debug the issue here. Running this on leaf worked well. I could see logs stored on disk, and deleted appropriately after compactions. Obviously this is only one set of options. The unit tests cover different options. Seems like I'm missing some edge cases.
      
      Reviewers: dhruba, haobo, leveldb
      
      CC: xinyaohu, sumeet
      
      Differential Revision: https://reviews.facebook.net/D13239
      cbf4a064
    • N
      Make db_test more robust · 11607141
      Naman Gupta 提交于
      Summary: While working on D13239, I noticed that the same options are not used for opening and destroying at db. So adding that. Also added asserts for successful DestroyDB calls.
      
      Test Plan: Ran unit tests. Atleast 1 unit test is failing. They failures are a result of some past logic change. I'm not really planning to fix those. But I would like to check this in. And hopefully the respective unit test owners can fix the broken tests
      
      Reviewers: leveldb, haobo
      
      CC: xinyaohu, sumeet, dhruba
      
      Differential Revision: https://reviews.facebook.net/D13329
      11607141
  23. 06 10月, 2013 3 次提交
  24. 05 10月, 2013 2 次提交
    • D
      Change namespace from leveldb to rocksdb · a143ef9b
      Dhruba Borthakur 提交于
      Summary:
      Change namespace from leveldb to rocksdb. This allows a single
      application to link in open-source leveldb code as well as
      rocksdb code into the same process.
      
      Test Plan: compile rocksdb
      
      Reviewers: emayanke
      
      Reviewed By: emayanke
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D13287
      a143ef9b
    • M
      Add backward compatible option in GetLiveFiles to choose whether to not Flush first · 854d2363
      Mayank Agarwal 提交于
      Summary:
      As explained in comments in GetLiveFiles in db.h, this option will cause flush to be skipped in GetLiveFiles because some use-cases use GetSortedWalFiles after GetLiveFiles to generate more complete snapshots.
      Using GetSortedWalFiles after GetLiveFiles allows us to not Flush in GetLiveFiles first because wals have everything.
      Note: file deletions will be disabled before calling GLF or GSWF so live logs will not move to archive logs or get delted.
      Note: Manifest file is truncated to a proper value in GLF, so it will always reply from the proper wal files on a restart
      
      Test Plan: make
      
      Reviewers: dhruba, haobo
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D13257
      854d2363