mirror of
https://github.com/facebook/rocksdb.git
synced 2024-11-26 16:30:56 +00:00
Remove iter_refresh_interval_us
Summary: The default, use one iter for the whole test, isn't good. This cost me a few hours of debugging and a few days of tessting. For readonly that isn't realistic and for read-write that keeps a lot of old sst files around. I remove the option because nothing uses it and not calling gettimeofday per loop iteration adds about 3% to QPS at 20 threads. Task ID: # Blame Rev: Test Plan: run db_bench Revert Plan: Database Impact: Memcache Impact: Other Notes: EImportant: - begin *PUBLIC* platform impact section - Bugzilla: # - end platform impact - Reviewers: igor Reviewed By: igor Subscribers: dhruba Differential Revision: https://reviews.facebook.net/D37965
This commit is contained in:
parent
dddceefe5e
commit
b6b100fe04
|
@ -550,8 +550,6 @@ DEFINE_string(flashcache_dev, "", "Path to flashcache device");
|
||||||
|
|
||||||
DEFINE_bool(use_tailing_iterator, false,
|
DEFINE_bool(use_tailing_iterator, false,
|
||||||
"Use tailing iterator to access a series of keys instead of get");
|
"Use tailing iterator to access a series of keys instead of get");
|
||||||
DEFINE_int64(iter_refresh_interval_us, -1,
|
|
||||||
"How often to refresh iterators. Disable refresh when -1");
|
|
||||||
|
|
||||||
DEFINE_bool(use_adaptive_mutex, rocksdb::Options().use_adaptive_mutex,
|
DEFINE_bool(use_adaptive_mutex, rocksdb::Options().use_adaptive_mutex,
|
||||||
"Use adaptive mutex");
|
"Use adaptive mutex");
|
||||||
|
@ -2697,7 +2695,6 @@ class Benchmark {
|
||||||
multi_iters.push_back(db_with_cfh.db->NewIterator(options));
|
multi_iters.push_back(db_with_cfh.db->NewIterator(options));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
uint64_t last_refresh = FLAGS_env->NowMicros();
|
|
||||||
|
|
||||||
std::unique_ptr<const char[]> key_guard;
|
std::unique_ptr<const char[]> key_guard;
|
||||||
Slice key = AllocateKey(&key_guard);
|
Slice key = AllocateKey(&key_guard);
|
||||||
|
@ -2705,23 +2702,19 @@ class Benchmark {
|
||||||
Duration duration(FLAGS_duration, reads_);
|
Duration duration(FLAGS_duration, reads_);
|
||||||
char value_buffer[256];
|
char value_buffer[256];
|
||||||
while (!duration.Done(1)) {
|
while (!duration.Done(1)) {
|
||||||
if (!FLAGS_use_tailing_iterator && FLAGS_iter_refresh_interval_us >= 0) {
|
if (!FLAGS_use_tailing_iterator) {
|
||||||
uint64_t now = FLAGS_env->NowMicros();
|
if (db_.db != nullptr) {
|
||||||
if (now - last_refresh > (uint64_t)FLAGS_iter_refresh_interval_us) {
|
delete single_iter;
|
||||||
if (db_.db != nullptr) {
|
single_iter = db_.db->NewIterator(options);
|
||||||
delete single_iter;
|
} else {
|
||||||
single_iter = db_.db->NewIterator(options);
|
for (auto iter : multi_iters) {
|
||||||
} else {
|
delete iter;
|
||||||
for (auto iter : multi_iters) {
|
}
|
||||||
delete iter;
|
multi_iters.clear();
|
||||||
}
|
for (const auto& db_with_cfh : multi_dbs_) {
|
||||||
multi_iters.clear();
|
multi_iters.push_back(db_with_cfh.db->NewIterator(options));
|
||||||
for (const auto& db_with_cfh : multi_dbs_) {
|
|
||||||
multi_iters.push_back(db_with_cfh.db->NewIterator(options));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
last_refresh = now;
|
|
||||||
}
|
}
|
||||||
// Pick a Iterator to use
|
// Pick a Iterator to use
|
||||||
Iterator* iter_to_use = single_iter;
|
Iterator* iter_to_use = single_iter;
|
||||||
|
|
Loading…
Reference in a new issue