Skip to content

Commit

Permalink
fix check_point file not found
Browse files Browse the repository at this point in the history
  • Loading branch information
yapple committed Jun 29, 2022
1 parent 4445935 commit 806c621
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 6 additions & 1 deletion db/db_filesnapshot.cc
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,12 @@ Status DBImpl::FakeFlush(std::vector<std::string>& ret) {
VersionEdit* edit = &iter.second;
int cf_id = iter.first;
for (auto f : edit->GetNewFiles()) {
ret.push_back(MakeTableFileName("", f.second.fd.GetNumber()));
ret.push_back(MakeTableFileName(versions_->GetColumnFamilySet()
->GetColumnFamily(cf_id)
->ioptions()
->cf_paths[0]
.path,
f.second.fd.GetNumber()));
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion utilities/checkpoint/checkpoint_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ Status CheckpointImpl::CreateCustomCheckpoint(
uint64_t* sequence_number, uint64_t log_size_for_flush) {
Status s;
std::vector<std::string> live_files;
std::vector<std::string> fake_flush_files;
uint64_t manifest_file_size = 0;
uint64_t min_log_num = port::kMaxUint64;
*sequence_number = db_->GetLatestSequenceNumber();
Expand Down Expand Up @@ -205,8 +206,10 @@ Status CheckpointImpl::CreateCustomCheckpoint(

// this will return live_files prefixed with "/"
if(db_options.check_point_fake_flush){
s = db_->FakeFlush(live_files);
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{
s = db_->GetLiveFiles(live_files, &manifest_file_size, flush_memtable);
}
Expand Down

0 comments on commit 806c621

Please sign in to comment.