From 3d844dff1d17484c49b0b57a5c30d0dcf9c158a0 Mon Sep 17 00:00:00 2001 From: Andrew Kryczka Date: Thu, 24 Jun 2021 21:04:05 -0700 Subject: [PATCH] add missing fields to `GetLiveFilesMetaData()` (#8460) Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/8460 Reviewed By: jay-zhuang Differential Revision: D29381865 Pulled By: ajkr fbshipit-source-id: 47ba54c25f3cc039d72ea32e1df20875795683b3 --- HISTORY.md | 1 + db/version_set.cc | 3 +++ 2 files changed, 4 insertions(+) diff --git a/HISTORY.md b/HISTORY.md index 3c595d5a2..ec8fd9ed4 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -5,6 +5,7 @@ ### Bug Fixes * Blob file checksums are now printed in hexadecimal format when using the `manifest_dump` `ldb` command. +* `GetLiveFilesMetaData()` now populates the `temperature`, `oldest_ancester_time`, and `file_creation_time` fields of its `LiveFileMetaData` results when the information is available. Previously these fields always contained zero indicating unknown. ### New Features * ldb has a new feature, `list_live_files_metadata`, that shows the live SST files, as well as their LSM storage level and the column family they belong to. diff --git a/db/version_set.cc b/db/version_set.cc index 1b20fd05f..777d5cf6f 100644 --- a/db/version_set.cc +++ b/db/version_set.cc @@ -5552,6 +5552,9 @@ void VersionSet::GetLiveFilesMetaData(std::vector* metadata) { filemetadata.oldest_blob_file_number = file->oldest_blob_file_number; filemetadata.file_checksum = file->file_checksum; filemetadata.file_checksum_func_name = file->file_checksum_func_name; + filemetadata.temperature = file->temperature; + filemetadata.oldest_ancester_time = file->TryGetOldestAncesterTime(); + filemetadata.file_creation_time = file->TryGetFileCreationTime(); metadata->push_back(filemetadata); } }