Enable compaction filter for db_stress with user-defined timestamp (#10259)

Summary:
Before this PR, when user-defined timestamp is enabled, db_stress disables compaction filter.

This is no longer necessary after this PR, since the `DbStressCompactionFilter` is now aware of
the presence of timestamps.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/10259

Test Plan: TEST_TMPDIR=/dev/shm make crash_test_with_ts

Reviewed By: ajkr

Differential Revision: D37459692

Pulled By: riversand963

fbshipit-source-id: 8fe62e90a63bd9317fe1bb95a2b4984080c9e5ef
main
Yanqin Jin 3 years ago committed by Facebook GitHub Bot
parent c73d2a9d18
commit d3de59255a
  1. 11
      db_stress_tool/db_stress_compaction_filter.h
  2. 4
      db_stress_tool/db_stress_test_base.cc
  3. 1
      tools/db_crashtest.py

@ -36,9 +36,14 @@ class DbStressCompactionFilter : public CompactionFilter {
return Decision::kKeep;
}
uint64_t key_num = 0;
bool ok = GetIntVal(key.ToString(), &key_num);
assert(ok);
(void)ok;
{
Slice ukey_without_ts = key;
assert(ukey_without_ts.size() >= FLAGS_user_timestamp_size);
ukey_without_ts.remove_suffix(FLAGS_user_timestamp_size);
[[maybe_unused]] bool ok =
GetIntVal(ukey_without_ts.ToString(), &key_num);
assert(ok);
}
port::Mutex* key_mutex = state_->GetMutexForKey(cf_id_, key_num);
if (!key_mutex->TryLock()) {
return Decision::kKeep;

@ -2697,10 +2697,6 @@ void CheckAndSetOptionsForUserTimestamp(Options& options) {
exit(1);
}
#endif // !ROCKSDB_LITE
if (FLAGS_enable_compaction_filter) {
fprintf(stderr, "CompactionFilter not supported with timestamp.\n");
exit(1);
}
if (FLAGS_test_cf_consistency || FLAGS_test_batches_snapshots) {
fprintf(stderr,
"Due to per-key ts-seq ordering constraint, only the (default) "

@ -361,7 +361,6 @@ ts_params = {
"use_txn": 0,
"enable_blob_files": 0,
"use_blob_db": 0,
"enable_compaction_filter": 0,
"ingest_external_file_one_in": 0,
}

Loading…
Cancel
Save