Преглед на файлове

修改元数据相关bug

lzj_version
林子骥 преди 2 седмици
родител
ревизия
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();
for (size_t i = 0; i < compact->outputs.size(); 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,
out.smallest, out.largest);
out.smallest, out.largest,out.old_ts,out.new_ts);
}
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];
for (size_t i = 0; i < files.size(); 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);
}
}

Зареждане…
Отказ
Запис