瀏覽代碼

修改元数据相关bug

lzj_version
林子骥 3 週之前
父節點
當前提交
40ee2672a9
共有 2 個檔案被更改,包括 5 行新增2 行删除
  1. +3
    -1
      db/db_impl.cc
  2. +2
    -1
      db/version_set.cc

+ 3
- 1
db/db_impl.cc 查看文件

@ -902,8 +902,10 @@ Status DBImpl::InstallCompactionResults(CompactionState* compact) {
const int level = compact->compaction->level(); const int level = compact->compaction->level();
for (size_t i = 0; i < compact->outputs.size(); i++) { for (size_t i = 0; i < compact->outputs.size(); i++) {
const CompactionState::Output& out = compact->outputs[i]; const CompactionState::Output& out = compact->outputs[i];
// compact->compaction->edit()->AddFile(level + 1, out.number, out.file_size,
// out.smallest, out.largest);
compact->compaction->edit()->AddFile(level + 1, out.number, out.file_size, compact->compaction->edit()->AddFile(level + 1, out.number, out.file_size,
out.smallest, out.largest);
out.smallest, out.largest,out.old_ts,out.new_ts);
} }
return versions_->LogAndApply(compact->compaction->edit(), &mutex_); return versions_->LogAndApply(compact->compaction->edit(), &mutex_);
} }

+ 2
- 1
db/version_set.cc 查看文件

@ -1088,7 +1088,8 @@ Status VersionSet::WriteSnapshot(log::Writer* log) {
const std::vector<FileMetaData*>& files = current_->files_[level]; const std::vector<FileMetaData*>& files = current_->files_[level];
for (size_t i = 0; i < files.size(); i++) { for (size_t i = 0; i < files.size(); i++) {
const FileMetaData* f = files[i]; const FileMetaData* f = files[i];
edit.AddFile(level, f->number, f->file_size, f->smallest, f->largest);
//edit.AddFile(level, f->number, f->file_size, f->smallest, f->largest);
edit.AddFile(level, f->number, f->file_size, f->smallest, f->largest,f->oldest_ts,f->newer_ts);
} }
} }

Loading…
取消
儲存