1. 28 8月, 2019 1 次提交
  2. 27 8月, 2019 1 次提交
  3. 23 8月, 2019 1 次提交
    • S
      Atomic Flush Crash Test also covers the case that WAL is enabled. (#5729) · d8a27d93
      sdong 提交于
      Summary:
      AtomicFlushStressTest is a powerful test, but right now we only run it for atomic_flush=true + disable_wal=true. We further extend it to the case where atomic_flush=false + disable_wal = false. All the workload generation and validation can stay the same.
      Atomic flush crash test is also changed to switch between the two test scenarios. It makes the name "atomic flush crash test" out of sync from what it really does. We leave it as it is to avoid troubles with continous test set-up.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/5729
      
      Test Plan: Run "CRASH_TEST_KILL_ODD=188 TEST_TMPDIR=/dev/shm/ USE_CLANG=1 make whitebox_crash_test_with_atomic_flush", observe the settings used and see it passed.
      
      Differential Revision: D16969791
      
      fbshipit-source-id: 56e37487000ae631e31b0100acd7bdc441c04163
      d8a27d93
  4. 20 8月, 2019 1 次提交
    • S
      Slightly adjust atomic white box test's kill odd (#5717) · 8e12638f
      sdong 提交于
      Summary:
      Atomic white box test's kill odd is the same as normal test. However, in the scenario that only WritableFileWriter::Append() is blacklisted, WritableFileWriter::Flush() dominates the killing odds. Normally, most of WritableFileWriter::Flush() are called in WAL writes, where every write triggers a WAL flush. In atomic test, WAL is disabled, so the kill happens less frequently than we antipated. In some rare cases, the kill didn't end up with happening (for reasons I still don't fully understand) and cause the stress test timeout.
      
      If WAL is disabled, make the odds 5x likely to trigger.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/5717
      
      Test Plan: Run whitebox_crash_test_with_atomic_flush and whitebox_crash_test and observe the kill odds printed out.
      
      Differential Revision: D16897237
      
      fbshipit-source-id: cbf5d96f6fc0e980523d0f1f94bf4e72cdb82d1c
      8e12638f
  5. 23 7月, 2019 1 次提交
  6. 10 7月, 2019 1 次提交
  7. 13 6月, 2019 1 次提交
  8. 10 5月, 2019 1 次提交
    • A
      Fix bugs in FilePickerMultiGet (#5292) · 181bb43f
      anand76 提交于
      Summary:
      This PR fixes a couple of bugs in FilePickerMultiGet that were causing db_stress test failures. The failures were caused by -
      1. Improper handling of a key that matches the user key portion of an L0 file's largest key. In this case, the curr_index_in_curr_level file index in L0 for that key was getting incremented, but batch_iter_ was not advanced. By design, all keys in a batch are supposed to be checked against an L0 file before advancing to the next L0 file. Not advancing to the next key in the batch was causing a double increment of curr_index_in_curr_level due to the same key being processed again
      2. Improper handling of a key that matches the user key portion of the largest key in the last file of L1 and higher. This was resulting in a premature end to the processing of the batch for that level when the next key in the batch is a duplicate. Typically, the keys in MultiGet will not be duplicates, but its good to handle that case correctly
      
      Test -
      asan_crash
      make check
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/5292
      
      Differential Revision: D15282530
      
      Pulled By: anand1976
      
      fbshipit-source-id: d1a6a86e0af273169c3632db22a44d79c66a581f
      181bb43f
  9. 07 5月, 2019 1 次提交
  10. 04 5月, 2019 1 次提交
    • M
      Refresh snapshot list during long compactions (2nd attempt) (#5278) · 6a40ee5e
      Maysam Yabandeh 提交于
      Summary:
      Part of compaction cpu goes to processing snapshot list, the larger the list the bigger the overhead. Although the lifetime of most of the snapshots is much shorter than the lifetime of compactions, the compaction conservatively operates on the list of snapshots that it initially obtained. This patch allows the snapshot list to be updated via a callback if the compaction is taking long. This should let the compaction to continue more efficiently with much smaller snapshot list.
      For simplicity, to avoid the feature is disabled in two cases: i) When more than one sub-compaction are sharing the same snapshot list, ii) when Range Delete is used in which the range delete aggregator has its own copy of snapshot list.
      This fixes the reverted https://github.com/facebook/rocksdb/pull/5099 issue with range deletes.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/5278
      
      Differential Revision: D15203291
      
      Pulled By: maysamyabandeh
      
      fbshipit-source-id: fa645611e606aa222c7ce53176dc5bb6f259c258
      6a40ee5e
  11. 02 5月, 2019 1 次提交
  12. 01 5月, 2019 1 次提交
    • A
      Init compression dict handle before reading meta-blocks (#5267) · b02d0c23
      Andrew Kryczka 提交于
      Summary:
      At least one of the meta-block loading functions (`ReadRangeDelBlock`)
      uses the same block reading function (`NewDataBlockIterator`) as data
      block reads, which means it uses the dictionary handle. However, the
      dictionary handle was uninitialized while reading meta-blocks, causing
      readers to receive an error. This situation was only noticed when
      `cache_index_and_filter_blocks=true`.
      
      This PR initializes the handle to null while reading meta-blocks to
      prevent the error. It also adds support to `db_stress` /
      `db_crashtest.py` for `cache_index_and_filter_blocks`.
      
      Fixes #5263.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/5267
      
      Differential Revision: D15149264
      
      Pulled By: maysamyabandeh
      
      fbshipit-source-id: 991d38a306c62db5976778bfb050fa3cd4a0671b
      b02d0c23
  13. 30 4月, 2019 1 次提交
    • Y
      Disable pipelined write in atomic flush stress test (#5266) · 210b49ca
      Yanqin Jin 提交于
      Summary:
      Since currently pipelined write allows one thread to perform memtable writes
      while another thread is traversing the `flush_scheduler_`, it will cause an
      assertion failure in `FlushScheduler::Clear`. To unblock crash recoery tests,
      we temporarily disable pipelined write when atomic flush is enabled.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/5266
      
      Differential Revision: D15142285
      
      Pulled By: riversand963
      
      fbshipit-source-id: a0c20fe4ac543e08feaed602414f982054df7831
      210b49ca
  14. 19 4月, 2019 1 次提交
  15. 16 3月, 2019 1 次提交
  16. 12 2月, 2019 1 次提交
    • A
      Fix `compression_zstd_max_train_bytes` coverage in stress test (#4957) · 1218704b
      Andrew Kryczka 提交于
      Summary:
      Previously `finalize_and_sanitize` function was always zeroing out `compression_zstd_max_train_bytes`. It was only supposed to do that when non-ZSTD compression was used. But since `--compression_type` was an unknown argument (i.e., one that `db_crashtest.py` does not recognize and blindly forwards to `db_stress`), `finalize_and_sanitize` could not tell whether ZSTD was used. This PR fixes it simply by making `--compression_type` a known argument with snappy as default (same as `db_stress`).
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/4957
      
      Differential Revision: D13994302
      
      Pulled By: ajkr
      
      fbshipit-source-id: 1b0baea7331397822830970d3698642eb7a7df65
      1218704b
  17. 19 12月, 2018 1 次提交
  18. 14 12月, 2018 1 次提交
  19. 31 10月, 2018 1 次提交
  20. 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
  21. 19 9月, 2018 1 次提交
  22. 18 9月, 2018 1 次提交
  23. 15 8月, 2018 1 次提交
  24. 07 8月, 2018 1 次提交
  25. 24 7月, 2018 1 次提交
  26. 27 6月, 2018 1 次提交
  27. 20 6月, 2018 1 次提交
  28. 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
  29. 14 6月, 2018 1 次提交
  30. 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
  31. 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
  32. 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
  33. 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
  34. 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
  35. 28 4月, 2018 1 次提交
  36. 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
  37. 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
  38. 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
  39. 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