diff options
author | Aleksei Borzenkov <snaury@gmail.com> | 2022-06-16 15:23:38 +0300 |
---|---|---|
committer | Aleksei Borzenkov <snaury@gmail.com> | 2022-06-16 15:23:38 +0300 |
commit | 59ddda3782fe5a0c698326a3f00467e0704a630f (patch) | |
tree | ecac39a3632ce346e538ff0853dd5494e7aac53a | |
parent | f05e4e1257b81c8622067221f8fc22d8f5dd3be2 (diff) | |
download | ydb-59ddda3782fe5a0c698326a3f00467e0704a630f.tar.gz |
Improve switch logging in surg, KIKIMR-15122
ref:847d41f69977f7c7b6ed95fec91f74e752a1d140
-rw-r--r-- | ydb/core/tablet_flat/test/tool/surg/main.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ydb/core/tablet_flat/test/tool/surg/main.cpp b/ydb/core/tablet_flat/test/tool/surg/main.cpp index c196de6a7e..76d1594044 100644 --- a/ydb/core/tablet_flat/test/tool/surg/main.cpp +++ b/ydb/core/tablet_flat/test/tool/surg/main.cpp @@ -200,6 +200,11 @@ namespace NTest { IOutputStream &Out; }; + void DumpSnapshot(const NKikimrExecutorFlat::TLogMemSnap& snap) { + Cerr << " | Table " << snap.GetTable() << " snapshot " << snap.GetGeneration() << ":" << snap.GetStep() + << " epoch " << snap.GetHead() << Endl; + } + void DumpPart(const NKikimrExecutorFlat::TLogTableSnap& part) { Cerr << " | Table " << part.GetTable() << " level " << part.GetCompactionLevel() << Endl; for (auto& bundle : part.GetBundles()) { @@ -208,6 +213,9 @@ namespace NTest { Y_VERIFY(pageCollection.HasLargeGlobId(), "Found a page collection without a largeGlobId"); Cerr << " " << LogoBlobIDFromLogoBlobID(pageCollection.GetLargeGlobId().GetLead()); } + if (bundle.HasEpoch()) { + Cerr << " epoch " << bundle.GetEpoch(); + } Cerr << Endl; if (bundle.HasLegacy() || bundle.HasOpaque()) { auto overlay = NKikimr::NTable::TOverlay::Decode(bundle.GetLegacy(), bundle.GetOpaque()); @@ -342,9 +350,15 @@ int main(int argc, char *argv[]) NTest::TProtoDump<NKikimrExecutorFlat::TTablePartSwitch>(Cerr).Do(raw); TProtoBox<NKikimrExecutorFlat::TTablePartSwitch> proto(raw); + if (proto.HasTableSnapshoted()) { + NTest::DumpSnapshot(proto.GetTableSnapshoted()); + } if (proto.HasIntroducedParts()) { NTest::DumpPart(proto.GetIntroducedParts()); } + for (const auto& label : proto.GetLeavingBundles()) { + Cerr << " | - bundle " << LogoBlobIDFromLogoBlobID(label) << Endl; + } } else if (!strcmp(res->Get("blob"), "borrow")) { NTest::TProtoDump<NKikimrExecutorFlat::TBorrowedPart>(Cerr).Do(raw); |