Skip to content

Commit

Permalink
Enable checkpoint and backup in db_stress when timestamp is enabled (#…
Browse files Browse the repository at this point in the history
…10047)

Summary:
After #10030 and #10004, we can enable checkpoint and backup in stress tests when
user-defined timestamp is enabled.

This PR has no production risk.

Pull Request resolved: #10047

Test Plan:
```
TEST_TMPDIR=/dev/shm make crash_test_with_ts
```

Reviewed By: jowlyzhang

Differential Revision: D36641565

Pulled By: riversand963

fbshipit-source-id: d86c9d87efcc34c32d1aa176af691d32b897644a
  • Loading branch information
riversand963 authored and facebook-github-bot committed May 25, 2022
1 parent af7ae91 commit 9901e7f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
17 changes: 9 additions & 8 deletions db_stress_tool/db_stress_test_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1795,9 +1795,17 @@ Status StressTest::TestCheckpoint(ThreadState* thread,
for (size_t i = 0; s.ok() && i < rand_column_families.size(); ++i) {
std::string key_str = Key(rand_keys[0]);
Slice key = key_str;
std::string ts_str;
Slice ts;
ReadOptions read_opts;
if (FLAGS_user_timestamp_size > 0) {
ts_str = GenerateTimestampForRead();
ts = ts_str;
read_opts.timestamp = &ts;
}
std::string value;
Status get_status = checkpoint_db->Get(
ReadOptions(), cf_handles[rand_column_families[i]], key, &value);
read_opts, cf_handles[rand_column_families[i]], key, &value);
bool exists =
thread->shared->Exists(rand_column_families[i], rand_keys[0]);
if (get_status.ok()) {
Expand Down Expand Up @@ -2764,13 +2772,6 @@ void CheckAndSetOptionsForUserTimestamp(Options& options) {
fprintf(stderr, "Secondary instance does not support timestamp.\n");
exit(1);
}
if (FLAGS_checkpoint_one_in > 0) {
fprintf(stderr,
"-checkpoint_one_in=%d requires "
"DBImplReadOnly, which is not supported with timestamp\n",
FLAGS_checkpoint_one_in);
exit(1);
}
#ifndef ROCKSDB_LITE
if (FLAGS_enable_blob_files || FLAGS_use_blob_db) {
fprintf(stderr, "BlobDB not supported with timestamp.\n");
Expand Down
5 changes: 2 additions & 3 deletions tools/db_crashtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,14 +341,13 @@ def is_direct_io_supported(dbname):
"test_cf_consistency": 0,
"test_batches_snapshots": 0,
"user_timestamp_size": 8,
"delrangepercent": 0,
"delpercent": 5,
"use_merge": 0,
"use_full_merge_v1": 0,
"use_txn": 0,
"read_only": 0,
"backup_one_in": 0,
"secondary_catch_up_one_in": 0,
"continuous_verification_interval": 0,
"checkpoint_one_in": 0,
"enable_blob_files": 0,
"use_blob_db": 0,
"enable_compaction_filter": 0,
Expand Down

0 comments on commit 9901e7f

Please sign in to comment.