Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/compaction checker condition error #154

Merged
merged 1 commit into from
Jan 26, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/compaction_checker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void CompactionChecker::PickCompactionFiles(const std::string &cf_name) {
for (const auto &iter : props) {
if (maxFilesToCompact == 0) return;
// don't compact the SST created in 1 hour
if ( iter.second->creation_time < static_cast<uint64_t>(now-3600)) continue;
if ( iter.second->file_creation_time > static_cast<uint64_t>(now-3600)) continue;
for (const auto &property_iter : iter.second->user_collected_properties) {
if (property_iter.first == "total_keys") {
total_keys = std::atoi(property_iter.second.data());
Expand All @@ -68,8 +68,7 @@ void CompactionChecker::PickCompactionFiles(const std::string &cf_name) {

if (start_key.empty() || stop_key.empty()) continue;
// pick the file which was created more than 2 days
if ((iter.second->creation_time < static_cast<uint64_t>(now-forceCompactSeconds))
|| (iter.second->file_creation_time < static_cast<uint64_t>(now-forceCompactSeconds))) {
if (iter.second->file_creation_time < static_cast<uint64_t>(now-forceCompactSeconds)) {
// the db is closing, don't use DB and cf_handles
if (!storage_->IncrDBRefs().IsOK()) return;
LOG(INFO) << "[compaction checker] Going to compact the key in file(created more than 2 days): " << iter.first;
Expand Down