Skip to content

Commit

Permalink
remove an undefined and unused column family method
Browse files Browse the repository at this point in the history
  • Loading branch information
jowlyzhang committed Aug 7, 2023
1 parent 5243665 commit 17120c7
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 66 deletions.
2 changes: 0 additions & 2 deletions db/column_family.h
Original file line number Diff line number Diff line change
Expand Up @@ -519,8 +519,6 @@ class ColumnFamilyData {
return file_metadata_cache_res_mgr_;
}

SequenceNumber GetFirstMemtableSequenceNumber() const;

static const uint32_t kDummyColumnFamilyDataId;

// Keep track of whether the mempurge feature was ever used.
Expand Down
11 changes: 0 additions & 11 deletions db_stress_tool/db_stress_common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -316,17 +316,6 @@ std::string GetNowNanos() {
return ret;
}

std::string GetFullHistoryTsLowForCutoffTs(const std::string& cutoff_ts) {
Slice cutoff_udt_slice = cutoff_ts;
uint64_t cutoff_udt_ts = 0;
bool format_res = GetFixed64(&cutoff_udt_slice, &cutoff_udt_ts);
assert(format_res);
(void)format_res;
std::string full_history_ts_low;
PutFixed64(&full_history_ts_low, cutoff_udt_ts + 1);
return full_history_ts_low;
}

namespace {

class MyXXH64Checksum : public FileChecksumGenerator {
Expand Down
2 changes: 0 additions & 2 deletions db_stress_tool/db_stress_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,6 @@ DECLARE_uint32(memtable_protection_bytes_per_key);
DECLARE_uint32(block_protection_bytes_per_key);

DECLARE_uint64(user_timestamp_size);
DECLARE_bool(persist_user_defined_timestamps);
DECLARE_string(secondary_cache_uri);
DECLARE_int32(secondary_cache_fault_one_in);

Expand Down Expand Up @@ -677,7 +676,6 @@ extern void InitializeHotKeyGenerator(double alpha);
extern int64_t GetOneHotKeyID(double rand_seed, int64_t max_key);

extern std::string GetNowNanos();
extern std::string GetFullHistoryTsLowForCutoffTs(const std::string& cutoff_ts);

std::shared_ptr<FileChecksumGenFactory> GetFileChecksumImpl(
const std::string& name);
Expand Down
2 changes: 0 additions & 2 deletions db_stress_tool/db_stress_gflags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1001,8 +1001,6 @@ DEFINE_int32(write_fault_one_in, 0,
DEFINE_uint64(user_timestamp_size, 0,
"Number of bytes for a user-defined timestamp. Currently, only "
"8-byte is supported");
DEFINE_bool(persist_user_defined_timestamps, true,
"If false, user-defined timestamps will be removed during flush.");

DEFINE_int32(open_metadata_write_fault_one_in, 0,
"On non-zero, enables fault injection on file metadata write "
Expand Down
20 changes: 1 addition & 19 deletions db_stress_tool/db_stress_test_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,6 @@ void StressTest::PreloadDbAndReopenAsReadOnly(int64_t number_of_keys,
int cf_idx = 0;
Status s;
for (auto cfh : column_families_) {
std::string ts;
for (int64_t k = 0; k != number_of_keys; ++k) {
const std::string key = Key(k);

Expand All @@ -491,6 +490,7 @@ void StressTest::PreloadDbAndReopenAsReadOnly(int64_t number_of_keys,

const Slice v(value, sz);

std::string ts;
if (FLAGS_user_timestamp_size > 0) {
ts = GetNowNanos();
}
Expand Down Expand Up @@ -529,12 +529,6 @@ void StressTest::PreloadDbAndReopenAsReadOnly(int64_t number_of_keys,
break;
}
}

if (FLAGS_user_timestamp_size > 0 &&
!FLAGS_persist_user_defined_timestamps) {
std::string full_history_ts_low = GetFullHistoryTsLowForCutoffTs(ts);
db_->IncreaseFullHistoryTsLow(cfh, full_history_ts_low);
}
if (!s.ok()) {
break;
}
Expand Down Expand Up @@ -2508,8 +2502,6 @@ void StressTest::PrintEnv() const {
static_cast<int>(FLAGS_fail_if_options_file_error));
fprintf(stdout, "User timestamp size bytes : %d\n",
static_cast<int>(FLAGS_user_timestamp_size));
fprintf(stdout, "Persist user defined timestamps: %d\n",
FLAGS_persist_user_defined_timestamps);
fprintf(stdout, "WAL compression : %s\n",
FLAGS_wal_compression.c_str());
fprintf(stdout, "Try verify sst unique id : %d\n",
Expand Down Expand Up @@ -2918,10 +2910,6 @@ bool StressTest::MaybeUseOlderTimestampForPointLookup(ThreadState* thread,
return false;
}

if (!FLAGS_persist_user_defined_timestamps) {
return false;
}

assert(thread);
if (!thread->rand.OneInOpt(3)) {
return false;
Expand Down Expand Up @@ -2951,10 +2939,6 @@ void StressTest::MaybeUseOlderTimestampForRangeScan(ThreadState* thread,
return;
}

if (!FLAGS_persist_user_defined_timestamps) {
return;
}

assert(thread);
if (!thread->rand.OneInOpt(3)) {
return;
Expand Down Expand Up @@ -3014,8 +2998,6 @@ void CheckAndSetOptionsForUserTimestamp(Options& options) {
exit(1);
}
options.comparator = cmp;
options.persist_user_defined_timestamps =
FLAGS_persist_user_defined_timestamps;
}

bool InitializeOptionsFromFile(Options& options) {
Expand Down
15 changes: 0 additions & 15 deletions db_stress_tool/no_batched_ops_stress.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1302,13 +1302,6 @@ class NonBatchedOpsStressTest : public StressTest {

pending_expected_value.Commit();

if (s.ok() && FLAGS_user_timestamp_size &&
!FLAGS_persist_user_defined_timestamps) {
std::string full_history_ts_low =
GetFullHistoryTsLowForCutoffTs(write_ts);
db_->IncreaseFullHistoryTsLow(cfh, full_history_ts_low);
}

if (!s.ok()) {
if (FLAGS_injest_error_severity >= 2) {
if (!is_db_stopped_ && s.severity() >= Status::Severity::kFatalError) {
Expand Down Expand Up @@ -1398,14 +1391,6 @@ class NonBatchedOpsStressTest : public StressTest {
});
}
pending_expected_value.Commit();

if (s.ok() && FLAGS_user_timestamp_size &&
!FLAGS_persist_user_defined_timestamps) {
std::string full_history_ts_low =
GetFullHistoryTsLowForCutoffTs(write_ts_str);
db_->IncreaseFullHistoryTsLow(cfh, full_history_ts_low);
}

thread->stats.AddSingleDeletes(1);
if (!s.ok()) {
if (FLAGS_injest_error_severity >= 2) {
Expand Down
15 changes: 0 additions & 15 deletions tools/db_crashtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,21 +660,6 @@ def finalize_and_sanitize(src_params):
dest_params["ingest_external_file_one_in"] = 0
dest_params["use_merge"] = 0
dest_params["use_full_merge_v1"] = 0
if (
dest_params.get("user_timestamp_size") > 1
and dest_params.get("persist_user_defined_timestamps") == 0
):
dest_params["delpercent"] += dest_params["delrangepercent"]
dest_params["delrangepercent"] = 0
dest_params["enable_blob_files"] = 0
dest_params["allow_concurrent_memtable_write"] = 0
dest_params["atomic_flush"] = 0
# check why this failure:
# Failure in DB::Open in backup/restore with: Corruption: Corrupted block entry: per key-value checksum verification failed. Offset: 0. Entry index: 0.
# Verification failed: Backup/restore gave inconsistent state. Status is Corruption: Corrupted block entry: per key-value checksum verification failed. Offset: 0. Entry index: 0.
# Verification failed :(
# dest_params["backup_one_in"] = 0
dest_params["block_protection_bytes_per_key"] = 0

return dest_params

Expand Down

0 comments on commit 17120c7

Please sign in to comment.