1. 23 8月, 2013 2 次提交
    • S
      Add APIs to query SST file metadata and to delete specific SST files · 60bf2b7d
      Simha Venkataramaiah 提交于
      Summary: An api to query the level, key ranges, size etc for each SST file and an api to delete a specific file from the db and all associated state in the bookkeeping datastructures.
      
      Notes: Editing the manifest version does not release the obsolete files right away. However deleting the file directly will mess up the iterator. We may need a more aggressive/timely file deletion api.
      
      I have used std::unique_ptr - will switch to boost:: since this is external. thoughts?
      
      Unit test is fragile right now as it expects the compaction at certain levels.
      
      Test Plan: unittest
      
      Reviewers: dhruba, vamsi, emayanke
      
      CC: zshao, leveldb, haobo
      
      Task ID: #
      
      Blame Rev:
      60bf2b7d
    • J
      Do not use relative paths in build system · bc8eed12
      Jim Paton 提交于
      Summary: Previously, RocksDB's build scripts used relative pathnames like ./build_detect_platform. This can cause problems if the user uses CDPATH. Also, it just doesn't seem right to me.
      
      Test Plan:
      make clean
      make -j32 check
      
      Reviewers: MarkCallaghan, dhruba, kailiu
      
      Reviewed By: kailiu
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D12459
      bc8eed12
  2. 22 8月, 2013 2 次提交
    • J
      Allow WriteBatch::Handler to abort iteration · cb703c9d
      Jim Paton 提交于
      Summary:
      Sometimes you don't need to iterate through the whole WriteBatch. This diff makes the Handler member functions return a bool that indicates whether to abort or not. If they return true, the iteration stops.
      
      One thing I just thought of is that this will break backwards-compability. Maybe it would be better to add a virtual member function WriteBatch::Handler::ShouldAbort() that returns false by default. Comments requested.
      
      I still have to add a new unit test for the abort code, but let's finalize the API first.
      
      Test Plan: make -j32 check
      
      Reviewers: dhruba, haobo, vamsi, emayanke
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D12339
      cb703c9d
    • H
      [RocksDB] Minor iterator cleanup · f9e2decf
      Haobo Xu 提交于
      Summary: Was going through the iterator related code, did some cleanup along the way. Basically replaced array with vector and adopted range based loop where applicable.
      
      Test Plan: make check; make valgrind_check
      
      Reviewers: dhruba, emayanke
      
      Reviewed By: emayanke
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D12435
      f9e2decf
  3. 21 8月, 2013 3 次提交
  4. 20 8月, 2013 4 次提交
  5. 17 8月, 2013 2 次提交
  6. 16 8月, 2013 7 次提交
    • M
      Expose statistic for sequence number and implement setTickerCount · 387ac0f1
      Mayank Agarwal 提交于
      Summary: statistic for sequence number is needed by wormhole. setTickerCount is demanded for this statistic. I can't simply recordTick(max_sequence) when db recovers because the statistic iobject is owned by client and may/may not be reset during reopen. Eg. statistic is reset in mcrocksdb whereas it is not in db_stress. Therefore it is best to go with setTickerCount
      
      Test Plan: ./db_stress ... --statistics=1 and observed expected sequence number
      
      Reviewers: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D12327
      387ac0f1
    • D
      Tiny fix to db_bench for make release. · d1d3d15e
      Deon Nicholas 提交于
      Summary:
      In release, "found variable assigned but not used anywhere". Changed it to work with
      assert. Someone accept this :).
      
      Test Plan: make release -j 32
      
      Reviewers: haobo, dhruba, emayanke
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D12309
      d1d3d15e
    • D
      Benchmarking for Merge Operator · ad48c3c2
      Deon Nicholas 提交于
      Summary:
      Updated db_bench and utilities/merge_operators.h to allow for dynamic benchmarking
      of merge operators in db_bench. Added a new test (--benchmarks=mergerandom), which performs
      a bunch of random Merge() operations over random keys. Also added a "--merge_operator=" flag
      so that the tester can easily benchmark different merge operators. Currently supports
      the PutOperator and UInt64Add operator. Support for stringappend or list append may come later.
      
      Test Plan:
      	1. make db_bench
      	2. Test the PutOperator (simulating Put) as follows:
      ./db_bench --benchmarks=fillrandom,readrandom,updaterandom,readrandom,mergerandom,readrandom --merge_operator=put
      --threads=2
      
      3. Test the UInt64AddOperator (simulating numeric addition) similarly:
      ./db_bench --value_size=8 --benchmarks=fillrandom,readrandom,updaterandom,readrandom,mergerandom,readrandom
      --merge_operator=uint64add --threads=2
      
      Reviewers: haobo, dhruba, zshao, MarkCallaghan
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D11535
      ad48c3c2
    • K
      Commit the correct fix for Jenkin failure · f3dea8c1
      Kai Liu 提交于
      Summary:
      
      My last commit is not the correct one. Fix it in this diff.
      
      Test Plan:
      
      Reviewers:
      
      CC:
      
      Task ID: #
      
      Blame Rev:
      f3dea8c1
    • K
      Fix Jenkin build failure · 159c19ac
      Kai Liu 提交于
      Summary:
      
      Previously I changed the line `source ./fbcode.gcc471.sh` to `source fbcode.gcc471.sh`. It works in my devbox but failed in some jenkin servers. I revert the previous code to make sure it works well under all circumstances.
      
      Test Plan:
      
      Test in the jenkin server as well as dev box.
      
      Reviewers:
      
      CC:
      
      Task ID: #
      
      Blame Rev:
      159c19ac
    • K
      Clean up the Makefile and the build scripts · 457dcc60
      Kai Liu 提交于
      Summary: As Aaron suggested, there are quite some problems with our Makefile and scripts. So in this diff I did some cleanup for them and revise some part of the scripts/makefile to help people better understand some mysterious parts.
      
      Test Plan:
      Ran make in several modes;
      Ran the updated scripts.
      
      Reviewers: dhruba, emayanke, akushner
      
      Differential Revision: https://reviews.facebook.net/D12285
      457dcc60
    • T
      Update crashtests to match D12267 · 85d83a15
      Tyler Harter 提交于
      Summary: I changed the db_stress configs, but forgot to update the scripts using the old configs.
      
      Test Plan: 'make blackbox_crash_test' and 'make whitebox_crash_test' start running normally now (I haven't run them til the end, though).
      
      Reviewers: vamsi
      
      Reviewed By: vamsi
      
      CC: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D12303
      85d83a15
  7. 15 8月, 2013 5 次提交
    • X
      Minor fix to current codes · 0a5afd1a
      Xing Jin 提交于
      Summary:
      Minor fix to current codes, including: coding style, output format,
      comments. No major logic change. There are only 2 real changes, please see my inline comments.
      
      Test Plan: make all check
      
      Reviewers: haobo, dhruba, emayanke
      
      Differential Revision: https://reviews.facebook.net/D12297
      0a5afd1a
    • T
      Add prefix scans to db_stress (and bug fix in prefix scan) · 7612d496
      Tyler Harter 提交于
      Summary: Added support for prefix scans.
      
      Test Plan: ./db_stress --max_key=4096 --ops_per_thread=10000
      
      Reviewers: dhruba, vamsi
      
      Reviewed By: vamsi
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D12267
      7612d496
    • J
      Implement log blobs · 0307c5fe
      Jim Paton 提交于
      Summary:
      This patch adds the ability for the user to add sequences of arbitrary data (blobs) to write batches. These blobs are saved to the log along with everything else in the write batch. You can add multiple blobs per WriteBatch and the ordering of blobs, puts, merges, and deletes are preserved.
      
      Blobs are not saves to SST files. RocksDB ignores blobs in every way except for writing them to the log.
      
      Before committing this patch, I need to add some test code. But I'm submitting it now so people can comment on the API.
      
      Test Plan: make -j32 check
      
      Reviewers: dhruba, haobo, vamsi
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D12195
      0307c5fe
    • H
      [RocksDB] Expose thread local perf counter for low overhead, per call level performance statistics. · d9dd2a19
      Haobo Xu 提交于
      Summary:
      As title. No locking/atomic is needed due to thread local. There is also no need to modify the existing client interface, in order to expose related counters.
      
      perf_context_test shows a simple example of retrieving the number of user key comparison done for each put and get call. More counters could be added later.
      
      Sample output
      ./perf_context_test 1000000
      ==== Test PerfContextTest.KeyComparisonCount
      Inserting 1000000 key/value pairs
      ...
      total user key comparison get: 43446523
      total user key comparison put: 8017877
      max user key comparison get: 88939
      avg user key comparison get:43
      
      Basically, the current skiplist does well on average, but could perform poorly in extreme cases.
      
      Test Plan: run perf_context_test <total number of entries to put/get>
      
      Reviewers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D12225
      d9dd2a19
    • T
      Add options to dump. · a8f47a40
      Tyler Harter 提交于
      Summary: added options to Dump() I missed in D12027.  I also ran a script to look for other missing options and found a couple which I added.  Should we also print anything for "PrepareForBulkLoad", "memtable_factory", and "statistics"?  Or should we leave those alone since it's not easy to print useful info for those?
      
      Test Plan: run anything and look at LOG file to make sure these are printed now.
      
      Reviewers: dhruba
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D12219
      a8f47a40
  8. 14 8月, 2013 3 次提交
    • M
      Counter for merge failure · f1bf1694
      Mayank Agarwal 提交于
      Summary:
      With Merge returning bool, it can keep failing silently(eg. While faling to fetch timestamp in TTL). We need to detect this through a rocksdb counter which can get bumped whenever Merge returns false. This will also be super-useful for the mcrocksdb-counter service where Merge may fail.
      Added a counter NUMBER_MERGE_FAILURES and appropriately updated db/merge_helper.cc
      
      I felt that it would be better to directly add counter-bumping in Merge as a default function of MergeOperator class but user should not be aware of this, so this approach seems better to me.
      
      Test Plan: make all check
      
      Reviewers: dnicholas, haobo, dhruba, vamsi
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D12129
      f1bf1694
    • T
      Prefix filters for scans (v4) · f5f18422
      Tyler Harter 提交于
      Summary: Similar to v2 (db and table code understands prefixes), but use ReadOptions as in v3.  Also, make the CreateFilter code faster and cleaner.
      
      Test Plan: make db_test; export LEVELDB_TESTS=PrefixScan; ./db_test
      
      Reviewers: dhruba
      
      Reviewed By: dhruba
      
      CC: haobo, emayanke
      
      Differential Revision: https://reviews.facebook.net/D12027
      f5f18422
    • S
      Separate compaction filter for each compaction · 3b81df34
      sumeet 提交于
      Summary:
      If we have same compaction filter for each compaction,
      application cannot know about the different compaction processes.
      Later on, we can put in more details in compaction filter for the
      application to consume and use it according to its needs. For e.g. In
      the universal compaction, we have a compaction process involving all the
      files while others don't involve all the files. Applications may want to
      collect some stats only when during full compaction.
      
      Test Plan: run existing unit tests
      
      Reviewers: haobo, dhruba
      
      Reviewed By: dhruba
      
      CC: xinyaohu, leveldb
      
      Differential Revision: https://reviews.facebook.net/D12057
      3b81df34
  9. 13 8月, 2013 3 次提交
  10. 10 8月, 2013 2 次提交
    • D
      Universal Compaction should keep DeleteMarkers unless it is the earliest file. · 93d77a27
      Dhruba Borthakur 提交于
      Summary:
      The pre-existing code was purging a DeleteMarker if thay key did not
      exist in deeper levels.  But in the Universal Compaction Style, all
      files are in Level0. For compaction runs that did not include the
      earliest file, we were erroneously purging the DeleteMarkers.
      
      The fix is to purge DeleteMarkers only if the compaction includes
      the earlist file.
      
      Test Plan: DBTest.Randomized triggers this code path.
      
      Differential Revision: https://reviews.facebook.net/D12081
      93d77a27
    • X
      Fix unit tests for universal compaction (step 2) · 8ae905ed
      Xing Jin 提交于
      Summary:
      Continue fixing existing unit tests for universal compaction. I have
      tried to apply universal compaction to all unit tests those haven't
      called ChangeOptions(). I left a few which are either apparently not
      applicable to universal compaction (because they check files/keys/values
      at level 1 or above levels), or apparently not related to compaction
      (e.g., open a file, open a db).
      
      I also add a new unit test for universal compaction.
      
      Good news is I didn't see any bugs during this round.
      
      Test Plan: Ran "make all check" yesterday. Has rebased and is rerunning
      
      Reviewers: haobo, dhruba
      
      Differential Revision: https://reviews.facebook.net/D12135
      8ae905ed
  11. 09 8月, 2013 2 次提交
  12. 08 8月, 2013 2 次提交
    • X
      Fix unit tests/bugs for universal compaction (first step) · 17b8f786
      Xing Jin 提交于
      Summary:
      This is the first step to fix unit tests and bugs for universal
      compactiion. I added universal compaction option to ChangeOptions(), and
      fixed all unit tests calling ChangeOptions(). Some of these tests
      obviously assume more than 1 level and check file number/values in level
      1 or above levels. I set kSkipUniversalCompaction for these tests.
      
      The major bug I found is manual compaction with universal compaction never stops. I have put a fix for
      it.
      
      I have also set universal compaction as the default compaction and found
      at least 20+ unit tests failing. I haven't looked into the details. The
      next step is to check all unit tests without calling ChangeOptions().
      
      Test Plan: make all check
      
      Reviewers: dhruba, haobo
      
      Differential Revision: https://reviews.facebook.net/D12051
      17b8f786
    • D
      Merge branch 'performance' of github.com:facebook/rocksdb into performance · f5fa26b6
      Dhruba Borthakur 提交于
      Conflicts:
      	db/builder.cc
      	db/db_impl.cc
      	db/version_set.cc
      	include/leveldb/statistics.h
      f5fa26b6
  13. 07 8月, 2013 3 次提交