1. 31 10月, 2018 1 次提交
  2. 20 9月, 2018 1 次提交
    • Z
      add missing range in random.choice argument (#4397) · 9b3cf908
      Zhongyi Xie 提交于
      Summary:
      This will fix the broken asan crash test:
      > Traceback (most recent call last):
        File "tools/db_crashtest.py", line 384, in <module>
          main()
        File "tools/db_crashtest.py", line 368, in main
          parser.add_argument("--" + k, type=type(v() if callable(v) else v))
        File "tools/db_crashtest.py", line 59, in <lambda>
          "index_block_restart_interval": lambda: random.choice(1, 16),
      TypeError: choice() takes exactly 2 arguments (3 given)
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/4397
      
      Differential Revision: D9933041
      
      Pulled By: miasantreble
      
      fbshipit-source-id: 10998e5bc6b6a5cea3e4088b18465affc246e639
      9b3cf908
  3. 19 9月, 2018 1 次提交
  4. 18 9月, 2018 1 次提交
  5. 15 8月, 2018 1 次提交
  6. 07 8月, 2018 1 次提交
  7. 24 7月, 2018 1 次提交
  8. 27 6月, 2018 1 次提交
  9. 20 6月, 2018 1 次提交
  10. 19 6月, 2018 2 次提交
    • A
      Support backup and checkpoint in db_stress (#4005) · 8585059a
      Andrew Kryczka 提交于
      Summary:
      Add the `backup_one_in` and `checkpoint_one_in` options to periodically trigger backups and checkpoints. The directory names contain thread ID to avoid clashing with parallel backups/checkpoints. Enable checkpoint in crash test so our CI runs will use it. Didn't enable backup in crash test since it copies all the files which is too slow.
      Closes https://github.com/facebook/rocksdb/pull/4005
      
      Differential Revision: D8472275
      
      Pulled By: ajkr
      
      fbshipit-source-id: ff91bdc37caac4ffd97aea8df96b3983313ac1d5
      8585059a
    • A
      Fix stderr processing in crash test (#4006) · de2c6fb1
      Andrew Kryczka 提交于
      Summary:
      Fixed bug where `db_stress` output a line with a warning followed by a line with an error, and `db_crashtest.py` considered that a success. For example:
      
      ```
      WARNING: prefix_size is non-zero but memtablerep != prefix_hash
      open error: Corruption: SST file is ahead of WALs
      ```
      Closes https://github.com/facebook/rocksdb/pull/4006
      
      Differential Revision: D8473463
      
      Pulled By: ajkr
      
      fbshipit-source-id: 60461bdd7491d9d26c63f7d4ee522a0f88ba3de7
      de2c6fb1
  11. 14 6月, 2018 1 次提交
  12. 05 6月, 2018 1 次提交
    • M
      Extend some tests to format_version=3 (#3942) · d0c38c0c
      Maysam Yabandeh 提交于
      Summary:
      format_version=3 changes the format of SST index. This is however not being tested currently since tests only work with the default format_version which is currently 2. The patch extends the most related tests to also test for format_version=3.
      Closes https://github.com/facebook/rocksdb/pull/3942
      
      Differential Revision: D8238413
      
      Pulled By: maysamyabandeh
      
      fbshipit-source-id: 915725f55753dd8e9188e802bf471c23645ad035
      d0c38c0c
  13. 04 6月, 2018 1 次提交
    • A
      Fix crash test check for direct I/O · 4f297ad0
      Andrew Kryczka 提交于
      Summary:
      We need to keep the DB directory around since the direct IO check in "db_crashtest.py" relies on it existing. This PR fixes an issue where it was removed after each stress test run during the second half of whitebox crash testing.
      Closes https://github.com/facebook/rocksdb/pull/3946
      
      Differential Revision: D8247998
      
      Pulled By: ajkr
      
      fbshipit-source-id: 4e7cffbdab9b40df125e7842d0d59916e76261d3
      4f297ad0
  14. 02 6月, 2018 1 次提交
    • A
      Configure direct I/O statically in db_stress · 88c3ee2d
      Andrew Kryczka 提交于
      Summary:
      Previously `db_stress` attempted to configure direct I/O dynamically in `SetOptions()` which had multiple problems (ummm must've never been tested):
      
      - It's a DB option so SetDBOptions should've been called instead
      - It's not a dynamic option so even SetDBOptions would fail
      - It required enabling SyncPoint to mask O_DIRECT since it had no way to detect whether the DB directory was in tmpfs or not. This required locking that consumed ~80% of db_stress CPU.
      
      In this PR I delete the broken dynamic config and instead configure it statically, only enabling it if the DB directory truly supports O_DIRECT.
      Closes https://github.com/facebook/rocksdb/pull/3939
      
      Differential Revision: D8238120
      
      Pulled By: ajkr
      
      fbshipit-source-id: 60bb2deebe6c9b54a3f788079261715b4a229279
      88c3ee2d
  15. 10 5月, 2018 1 次提交
    • A
      Refactor argument handling in db_crashtest.py · d19f568a
      Andrew Kryczka 提交于
      Summary:
      - Any options unknown to `db_crashtest.py` are now passed directly to `db_stress`. This way, we won't need to update `db_crashtest.py` every time `db_stress` gets a new option.
      - Remove `db_crashtest.py` redundant arguments where the value is the same as `db_stress`'s default
      - Remove `db_crashtest.py` redundant arguments where the value is the same in a previously applied options map. For example, default_params are always applied before whitebox_default_params, so if they require the same value for an argument, that value only needs to be provided in default_params.
      - Made the simple option maps applied in addition to the regular option maps. Previously they were exclusive which led to lots of duplication
      Closes https://github.com/facebook/rocksdb/pull/3809
      
      Differential Revision: D7885779
      
      Pulled By: ajkr
      
      fbshipit-source-id: 3a3243b55724d6d5bff36e939b582b9b62c538a8
      d19f568a
  16. 01 5月, 2018 1 次提交
    • A
      Second attempt at db_stress crash-recovery verification · 46152d53
      Andrew Kryczka 提交于
      Summary:
      - Original commit: a4fb1f8c
      - Revert commit (we reverted as a quick fix to get crash tests passing): 6afe22db
      
      This PR includes the contents of the original commit plus two bug fixes, which are:
      
      - In whitebox crash test, only set `--expected_values_path` for `db_stress` runs in the first half of the crash test's duration. In the second half, a fresh DB is created for each `db_stress` run, so we cannot maintain expected state across `db_stress` runs.
      - Made `Exists()` return true for `UNKNOWN_SENTINEL` values. I previously had an assert in `Exists()` that value was not `UNKNOWN_SENTINEL`. But it is possible for post-crash-recovery expected values to be `UNKNOWN_SENTINEL` (i.e., if the crash happens in the middle of an update), in which case this assertion would be tripped. The effect of returning true in this case is there may be cases where a `SingleDelete` deletes no data. But if we had returned false, the effect would be calling `SingleDelete` on a key with multiple older versions, which is not supported.
      Closes https://github.com/facebook/rocksdb/pull/3793
      
      Differential Revision: D7811671
      
      Pulled By: ajkr
      
      fbshipit-source-id: 67e0295bfb1695ff9674837f2e05bb29c50efc30
      46152d53
  17. 28 4月, 2018 1 次提交
  18. 27 4月, 2018 1 次提交
    • A
      Allow options file in db_stress and db_crashtest · db36f222
      Andrew Kryczka 提交于
      Summary:
      - When options file is provided to db_stress, take supported options from the file instead of from flags
      - Call `BuildOptionsTable` after `Open` so it can use `options_` once it has been populated either from flags or from file
      - Allow options filename to be passed via `db_crashtest.py`
      Closes https://github.com/facebook/rocksdb/pull/3768
      
      Differential Revision: D7755331
      
      Pulled By: ajkr
      
      fbshipit-source-id: 5205cc5deb0d74d677b9832174153812bab9a60a
      db36f222
  19. 25 4月, 2018 1 次提交
    • A
      Add crash-recovery correctness check to db_stress · a4fb1f8c
      Andrew Kryczka 提交于
      Summary:
      Previously, our `db_stress` tool held the expected state of the DB in-memory, so after crash-recovery, there was no way to verify data correctness. This PR adds an option, `--expected_values_file`, which specifies a file holding the expected values.
      
      In black-box testing, the `db_stress` process can be killed arbitrarily, so updates to the `--expected_values_file` must be atomic. We achieve this by `mmap`ing the file and relying on `std::atomic<uint32_t>` for atomicity. Actually this doesn't provide a total guarantee on what we want as `std::atomic<uint32_t>` could, in theory, be translated into multiple stores surrounded by a mutex. We can verify our assumption by looking at `std::atomic::is_always_lock_free`.
      
      For the `mmap`'d file, we didn't have an existing way to expose its contents as a raw memory buffer. This PR adds it in the `Env::NewMemoryMappedFileBuffer` function, and `MemoryMappedFileBuffer` class.
      
      `db_crashtest.py` is updated to use an expected values file for black-box testing. On the first iteration (when the DB is created), an empty file is provided as `db_stress` will populate it when it runs. On subsequent iterations, that same filename is provided so `db_stress` can check the data is as expected on startup.
      Closes https://github.com/facebook/rocksdb/pull/3629
      
      Differential Revision: D7463144
      
      Pulled By: ajkr
      
      fbshipit-source-id: c8f3e82c93e045a90055e2468316be155633bd8b
      a4fb1f8c
  20. 04 4月, 2018 1 次提交
    • A
      Reduce default --nooverwritepercent in black-box crash tests · b058a337
      Andrew Kryczka 提交于
      Summary:
      Previously `python tools/db_crashtest.py blackbox` would do no useful work as the crash interval (two minutes) was shorter than the preparation phase. The preparation phase is slow because of the ridiculously inefficient way it computes which keys should not be overwritten. It was doing this for 60M keys since default values were `FLAGS_nooverwritepercent == 60` and `FLAGS_max_key == 100000000`.
      
      Move the "nooverwritepercent" override from whitebox-specific to the general options so it also applies to blackbox test runs. Now preparation phase takes a few seconds.
      Closes https://github.com/facebook/rocksdb/pull/3671
      
      Differential Revision: D7457732
      
      Pulled By: ajkr
      
      fbshipit-source-id: 601f4461a6a7e49e50449dcf15aebc9b8a98d6f0
      b058a337
  21. 30 1月, 2018 1 次提交
    • M
      Suppress lint in old files · b8eb32f8
      Mark Isaacson 提交于
      Summary: Grandfather in super old lint issues to make a clean slate for moving forward that allows us to have stronger enforcement on new issues.
      
      Reviewed By: yiwu-arbug
      
      Differential Revision: D6821806
      
      fbshipit-source-id: 22797d31ec58e9eb0255d3b66fedfcfcb0dc127c
      b8eb32f8
  22. 21 10月, 2017 1 次提交
    • A
      db_stress support long-held snapshots · d75793d6
      Andrew Kryczka 提交于
      Summary:
      Add options to `db_stress` (correctness testing tool) to randomly acquire snapshot and release it after some period of time. It's useful for correctness testing of #3009, as well as other parts of compaction that behave differently depending on which snapshots are held.
      Closes https://github.com/facebook/rocksdb/pull/3038
      
      Differential Revision: D6086501
      
      Pulled By: ajkr
      
      fbshipit-source-id: 3ec0d8666c78ac507f1f808887c4ff759ba9b865
      d75793d6
  23. 11 8月, 2017 1 次提交
  24. 15 7月, 2017 1 次提交
    • D
      db_crashtest.py: remove need for shell · 67510eef
      Daniel Black 提交于
      Summary:
      Before:
      $ ps -ef
      
      build     1713    16  0 Jul11 ?        00:00:00 make crash_test
      build     3437  1713  0 Jul11 ?        00:00:00 python -u tools/db_crashtest.py --simple blackbox
      build     3438  3437  0 Jul11 ?        00:00:00 [sh] <defunct>
      build     3440     1 99 Jul11 ?        5-03:01:25 ./db_stress --max_background_compactions=1 --max_write_buffer_number=3 --sync=0 --reopen=20 --write_buffer_size=33554432 --delpercent=5 --block_size=16384 --allow_concurrent_me
      
      After:
      
      build      1706     16  0 02:52 ?        00:00:01 make crash_test
      build      3432   1706  0 02:55 ?        00:00:00 python -u tools/db_crashtest.py --simple blackbox
      build      4452   3432 99 04:35 ?        00:01:42 ./db_stress --max_background_compactions=1 --max_write_buffer_number=3 --sync=0 --reopen=20 --write_buffer_size=33554432 --delpercent=5 --block_size=16384 --allow_concurr
      Closes https://github.com/facebook/rocksdb/pull/2571
      
      Differential Revision: D5421580
      
      Pulled By: maysamyabandeh
      
      fbshipit-source-id: d6c3970c38ea0fa23da653f4385e8e25d83f5c9f
      67510eef
  25. 12 4月, 2017 1 次提交
  26. 14 2月, 2017 1 次提交
    • S
      Remove disableDataSync option · eb912a92
      Sagar Vemuri 提交于
      Summary:
      Remove disableDataSync, and another similarly named disable_data_sync options.
      This is being done to simplify options, and also because the performance gains of this feature can be achieved by other methods.
      Closes https://github.com/facebook/rocksdb/pull/1859
      
      Differential Revision: D4541292
      
      Pulled By: sagar0
      
      fbshipit-source-id: 5b3a6ca
      eb912a92
  27. 25 8月, 2016 1 次提交
    • Y
      Disable ClockCache db_crashtest · d76ddf32
      Yi Wu 提交于
      Summary: Tempororily disable clock cache in db_crashtest while we investigate data race issue with clock cache.
      
      Test Plan:
          python ./tools/db_crashtest.py blackbox
      
      Reviewers: sdong, lightmark, IslamAbdelRahman
      
      Reviewed By: IslamAbdelRahman
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D62481
      d76ddf32
  28. 20 8月, 2016 1 次提交
    • Y
      Introduce ClockCache · 4cc37f59
      Yi Wu 提交于
      Summary:
      Clock-based cache implemenetation aim to have better concurreny than
      default LRU cache. See inline comments for implementation details.
      
      Test Plan:
      Update cache_test to run on both LRUCache and ClockCache. Adding some
      new tests to catch some of the bugs that I fixed while implementing the
      cache.
      
      Reviewers: kradhakrishnan, sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D61647
      4cc37f59
  29. 23 7月, 2016 1 次提交
  30. 21 7月, 2016 1 次提交
    • I
      Introduce FullMergeV2 (eliminate memcpy from merge operators) · 68a8e6b8
      Islam AbdelRahman 提交于
      Summary:
      This diff update the code to pin the merge operator operands while the merge operation is done, so that we can eliminate the memcpy cost, to do that we need a new public API for FullMerge that replace the std::deque<std::string> with std::vector<Slice>
      
      This diff is stacked on top of D56493 and D56511
      
      In this diff we
      - Update FullMergeV2 arguments to be encapsulated in MergeOperationInput and MergeOperationOutput which will make it easier to add new arguments in the future
      - Replace std::deque<std::string> with std::vector<Slice> to pass operands
      - Replace MergeContext std::deque with std::vector (based on a simple benchmark I ran https://gist.github.com/IslamAbdelRahman/78fc86c9ab9f52b1df791e58943fb187)
      - Allow FullMergeV2 output to be an existing operand
      
      ```
      [Everything in Memtable | 10K operands | 10 KB each | 1 operand per key]
      
      DEBUG_LEVEL=0 make db_bench -j64 && ./db_bench --benchmarks="mergerandom,readseq,readseq,readseq,readseq,readseq" --merge_operator="max" --merge_keys=10000 --num=10000 --disable_auto_compactions --value_size=10240 --write_buffer_size=1000000000
      
      [FullMergeV2]
      readseq      :       0.607 micros/op 1648235 ops/sec; 16121.2 MB/s
      readseq      :       0.478 micros/op 2091546 ops/sec; 20457.2 MB/s
      readseq      :       0.252 micros/op 3972081 ops/sec; 38850.5 MB/s
      readseq      :       0.237 micros/op 4218328 ops/sec; 41259.0 MB/s
      readseq      :       0.247 micros/op 4043927 ops/sec; 39553.2 MB/s
      
      [master]
      readseq      :       3.935 micros/op 254140 ops/sec; 2485.7 MB/s
      readseq      :       3.722 micros/op 268657 ops/sec; 2627.7 MB/s
      readseq      :       3.149 micros/op 317605 ops/sec; 3106.5 MB/s
      readseq      :       3.125 micros/op 320024 ops/sec; 3130.1 MB/s
      readseq      :       4.075 micros/op 245374 ops/sec; 2400.0 MB/s
      ```
      
      ```
      [Everything in Memtable | 10K operands | 10 KB each | 10 operand per key]
      
      DEBUG_LEVEL=0 make db_bench -j64 && ./db_bench --benchmarks="mergerandom,readseq,readseq,readseq,readseq,readseq" --merge_operator="max" --merge_keys=1000 --num=10000 --disable_auto_compactions --value_size=10240 --write_buffer_size=1000000000
      
      [FullMergeV2]
      readseq      :       3.472 micros/op 288018 ops/sec; 2817.1 MB/s
      readseq      :       2.304 micros/op 434027 ops/sec; 4245.2 MB/s
      readseq      :       1.163 micros/op 859845 ops/sec; 8410.0 MB/s
      readseq      :       1.192 micros/op 838926 ops/sec; 8205.4 MB/s
      readseq      :       1.250 micros/op 800000 ops/sec; 7824.7 MB/s
      
      [master]
      readseq      :      24.025 micros/op 41623 ops/sec;  407.1 MB/s
      readseq      :      18.489 micros/op 54086 ops/sec;  529.0 MB/s
      readseq      :      18.693 micros/op 53495 ops/sec;  523.2 MB/s
      readseq      :      23.621 micros/op 42335 ops/sec;  414.1 MB/s
      readseq      :      18.775 micros/op 53262 ops/sec;  521.0 MB/s
      
      ```
      
      ```
      [Everything in Block cache | 10K operands | 10 KB each | 1 operand per key]
      
      [FullMergeV2]
      $ DEBUG_LEVEL=0 make db_bench -j64 && ./db_bench --benchmarks="readseq,readseq,readseq,readseq,readseq" --merge_operator="max" --num=100000 --db="/dev/shm/merge-random-10K-10KB" --cache_size=1000000000 --use_existing_db --disable_auto_compactions
      readseq      :      14.741 micros/op 67837 ops/sec;  663.5 MB/s
      readseq      :       1.029 micros/op 971446 ops/sec; 9501.6 MB/s
      readseq      :       0.974 micros/op 1026229 ops/sec; 10037.4 MB/s
      readseq      :       0.965 micros/op 1036080 ops/sec; 10133.8 MB/s
      readseq      :       0.943 micros/op 1060657 ops/sec; 10374.2 MB/s
      
      [master]
      readseq      :      16.735 micros/op 59755 ops/sec;  584.5 MB/s
      readseq      :       3.029 micros/op 330151 ops/sec; 3229.2 MB/s
      readseq      :       3.136 micros/op 318883 ops/sec; 3119.0 MB/s
      readseq      :       3.065 micros/op 326245 ops/sec; 3191.0 MB/s
      readseq      :       3.014 micros/op 331813 ops/sec; 3245.4 MB/s
      ```
      
      ```
      [Everything in Block cache | 10K operands | 10 KB each | 10 operand per key]
      
      DEBUG_LEVEL=0 make db_bench -j64 && ./db_bench --benchmarks="readseq,readseq,readseq,readseq,readseq" --merge_operator="max" --num=100000 --db="/dev/shm/merge-random-10-operands-10K-10KB" --cache_size=1000000000 --use_existing_db --disable_auto_compactions
      
      [FullMergeV2]
      readseq      :      24.325 micros/op 41109 ops/sec;  402.1 MB/s
      readseq      :       1.470 micros/op 680272 ops/sec; 6653.7 MB/s
      readseq      :       1.231 micros/op 812347 ops/sec; 7945.5 MB/s
      readseq      :       1.091 micros/op 916590 ops/sec; 8965.1 MB/s
      readseq      :       1.109 micros/op 901713 ops/sec; 8819.6 MB/s
      
      [master]
      readseq      :      27.257 micros/op 36687 ops/sec;  358.8 MB/s
      readseq      :       4.443 micros/op 225073 ops/sec; 2201.4 MB/s
      readseq      :       5.830 micros/op 171526 ops/sec; 1677.7 MB/s
      readseq      :       4.173 micros/op 239635 ops/sec; 2343.8 MB/s
      readseq      :       4.150 micros/op 240963 ops/sec; 2356.8 MB/s
      ```
      
      Test Plan: COMPILE_WITH_ASAN=1 make check -j64
      
      Reviewers: yhchiang, andrewkr, sdong
      
      Reviewed By: sdong
      
      Subscribers: lovro, andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D57075
      68a8e6b8
  31. 22 6月, 2016 1 次提交
  32. 19 4月, 2016 1 次提交
  33. 10 2月, 2016 1 次提交
    • S
      crash_test: cover concurrent memtable insert in default crash test · 2608219c
      sdong 提交于
      Summary: Default crash test uses prefix hash memtable, which is not compatible to concurrent memtable. Allow prefix test run with skip list and use skip list memtable when concurrent insert is used.
      
      Test Plan: Run "python -u tools/db_crashtest.py whitebox" and watch sometimes skip list is used.
      
      Reviewers: anthony, yhchiang, kradhakrishnan, andrewkr, IslamAbdelRahman
      
      Reviewed By: IslamAbdelRahman
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D53907
      2608219c
  34. 06 2月, 2016 1 次提交
    • S
      Explictly fail when memtable doesn't support concurrent insert · b1887c5d
      sdong 提交于
      Summary: If users turn on concurrent insert but the memtable doesn't support it, they might see unexcepted crash. Fix it by explicitly fail.
      
      Test Plan:
      Run different setting of stress_test and make sure it fails correctly.
      Will add a unit test too.
      
      Reviewers: anthony, kradhakrishnan, IslamAbdelRahman, yhchiang, andrewkr, ngbronson
      
      Reviewed By: ngbronson
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D53895
      b1887c5d
  35. 05 2月, 2016 1 次提交
  36. 20 1月, 2016 1 次提交
    • S
      Crash test to make kill decision for every kill point · fdbff423
      sdong 提交于
      Summary:
      In crash test, when coming to each kill point, we start a random class using seed as current second. With this approach, for every second, the random number used is the same. However, in each second, there are multiple kill points with different frequency. It makes it hard to reason about chance of kill point to trigger. With this commit, we use thread local random seed to generate the random number, so that it will take different values per second, hoping it makes chances of killing much easier to reason about.
      
      Also significantly reduce the kill odd to make sure time before kiling is similar as before.
      
      Test Plan: Run white box crash test and see the killing happens as expected and the run time time before killing reasonable.
      
      Reviewers: kradhakrishnan, IslamAbdelRahman, rven, yhchiang, andrewkr, anthony
      
      Reviewed By: anthony
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D52971
      fdbff423
  37. 28 10月, 2015 1 次提交
  38. 21 10月, 2015 1 次提交
    • S
      fix bug in db_crashtest.py · d0d13ebf
      Shusen Liu 提交于
      Summary:
      in tools/db_crashtest.py, cmd_params['db'] by default is a lambda expression, not the actual db_name.
      fix by get the db_name before passing it to gen_cmd.
      
      Test Plan: run `make crashtest`
      
      Reviewers: sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D49119
      d0d13ebf
  39. 20 10月, 2015 1 次提交