Skip to content

Commit

Permalink
fix manifest too large
Browse files Browse the repository at this point in the history
  • Loading branch information
yapple committed Jun 30, 2022
1 parent b905041 commit 5245313
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion db/version_builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ bool VersionBuilder::CheckConsistencyForNumLevels() {

void VersionBuilder::Apply(VersionEdit* edit) {
// not change the current state
if(edit->check_point()) return;
// if(edit->check_point()) return;
rep_->Apply(edit);
}

Expand Down
2 changes: 1 addition & 1 deletion db/version_edit.h
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ class VersionEdit {
std::string DebugString(bool hex_key = false) const;
std::string DebugJSON(int edit_num, bool hex_key = false) const;

bool check_point() { return for_checkpoint_; }
bool check_point() const { return for_checkpoint_; }
void set_check_point(bool b) { for_checkpoint_ = b; }

private:
Expand Down
2 changes: 1 addition & 1 deletion include/rocksdb/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,7 @@ struct DBOptions {
// transaction is encountered in the WAL
bool allow_2pc = false;

bool check_point_fake_flush = true;
bool check_point_fake_flush = false;

// A global cache for table-level rows.
// Default: nullptr (disabled)
Expand Down
14 changes: 9 additions & 5 deletions utilities/checkpoint/checkpoint_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,16 @@ Status CheckpointImpl::CreateCustomCheckpoint(
}

// this will return live_files prefixed with "/"
if(db_options.check_point_fake_flush){
if (db_options.check_point_fake_flush) {
s = db_->FakeFlush(fake_flush_files);
s = db_->GetLiveFiles(live_files, &manifest_file_size, false);
live_files.insert(live_files.end(), fake_flush_files.begin(),
fake_flush_files.end());
}else{
if (s.ok()) {
s = db_->GetLiveFiles(live_files, &manifest_file_size, false);
}
if (s.ok()) {
live_files.insert(live_files.end(), fake_flush_files.begin(),
fake_flush_files.end());
}
} else {
s = db_->GetLiveFiles(live_files, &manifest_file_size, flush_memtable);
}

Expand Down

0 comments on commit 5245313

Please sign in to comment.