Skip to content

Commit

Permalink
CompactionJob::FinishCompactionOutputFile: sync TableProperties to Fi…
Browse files Browse the repository at this point in the history
…leMeta
  • Loading branch information
rockeet committed Dec 28, 2023
1 parent 01f2edd commit ac55785
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions db/compaction/compaction_outputs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,16 @@ Status CompactionOutputs::Finish(
}
const uint64_t current_bytes = builder_->FileSize();
if (s.ok()) {
auto tp = builder_->GetTableProperties();
meta->fd.file_size = current_bytes;
meta->tail_size = builder_->GetTailSize();
meta->marked_for_compaction = builder_->NeedCompact();
meta->user_defined_timestamps_persisted = static_cast<bool>(
builder_->GetTableProperties().user_defined_timestamps_persisted);
meta->num_entries = tp.num_entries;
meta->num_deletions = tp.num_deletions;
meta->raw_key_size = tp.raw_key_size;
meta->raw_value_size = tp.raw_value_size;
meta->user_defined_timestamps_persisted =
static_cast<bool>(tp.user_defined_timestamps_persisted);
}
current_output().finished = true;
stats_.bytes_written += current_bytes;
Expand Down

0 comments on commit ac55785

Please sign in to comment.