From a7d103198ee27fbd3f9146e57355ea02eb10836d Mon Sep 17 00:00:00 2001 From: qinzuoyan Date: Tue, 23 Apr 2019 11:14:41 -0700 Subject: [PATCH] Print smallest and largest seqno in Version::DebugString() for more details (#5231) Summary: In some cases, we want to known the smallest and largest sequence numbers of sstable files, to help us get more details. Pull Request resolved: https://github.com/facebook/rocksdb/pull/5231 Differential Revision: D15038087 Pulled By: siying fbshipit-source-id: c473c1ca07b53efe2f1884fa1ecdc8686f455ed8 --- db/version_set.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/db/version_set.cc b/db/version_set.cc index fae4c157a..fdc07fee0 100644 --- a/db/version_set.cc +++ b/db/version_set.cc @@ -3235,11 +3235,11 @@ std::string Version::DebugString(bool hex, bool print_stats) const { for (int level = 0; level < storage_info_.num_levels_; level++) { // E.g., // --- level 1 --- - // 17:123['a' .. 'd'] - // 20:43['e' .. 'g'] + // 17:123[1 .. 124]['a' .. 'd'] + // 20:43[124 .. 128]['e' .. 'g'] // // if print_stats=true: - // 17:123['a' .. 'd'](4096) + // 17:123[1 .. 124]['a' .. 'd'](4096) r.append("--- level "); AppendNumberTo(&r, level); r.append(" --- version# "); @@ -3252,6 +3252,11 @@ std::string Version::DebugString(bool hex, bool print_stats) const { r.push_back(':'); AppendNumberTo(&r, files[i]->fd.GetFileSize()); r.append("["); + AppendNumberTo(&r, files[i]->fd.smallest_seqno); + r.append(" .. "); + AppendNumberTo(&r, files[i]->fd.largest_seqno); + r.append("]"); + r.append("["); r.append(files[i]->smallest.DebugString(hex)); r.append(" .. "); r.append(files[i]->largest.DebugString(hex));