aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtem Zuikov <chertus@gmail.com>2022-07-06 21:35:54 +0300
committerArtem Zuikov <chertus@gmail.com>2022-07-06 21:35:54 +0300
commitf14366cffd67716184aa621e486dc9615db867a3 (patch)
tree629d33080937d52a37056024bb917346223aeede
parent8bfc750efbcb32aa186f6e9d71727c2eb9943aa0 (diff)
downloadydb-f14366cffd67716184aa621e486dc9615db867a3.tar.gz
KIKIMR-15281: relax verify on load: allow Keep + DontKeep + newer LastCollectedGenStep
ref:321d0ebe77b0066b0393081b425e8b8aebf05007
-rw-r--r--ydb/core/tx/columnshard/blob_manager.cpp32
1 files changed, 19 insertions, 13 deletions
diff --git a/ydb/core/tx/columnshard/blob_manager.cpp b/ydb/core/tx/columnshard/blob_manager.cpp
index 64bb13523c..db29182c8c 100644
--- a/ydb/core/tx/columnshard/blob_manager.cpp
+++ b/ydb/core/tx/columnshard/blob_manager.cpp
@@ -162,30 +162,36 @@ bool TBlobManager::LoadState(IBlobManagerDb& db) {
return false;
}
+ for (const auto& unifiedBlobId : blobsToDelete) {
+ if (unifiedBlobId.IsSmallBlob()) {
+ SmallBlobsToDelete.insert(unifiedBlobId);
+ } else if (unifiedBlobId.IsDsBlob()) {
+ BlobsToDelete.insert(unifiedBlobId.GetLogoBlobId());
+ } else {
+ Y_FAIL("Unexpected blob id: %s", unifiedBlobId.ToStringNew().c_str());
+ }
+ }
+
// Build the list of steps that cannot be garbage collected before Keep flag is set on the blobs
THashSet<TGenStep> genStepsWithBlobsToKeep;
for (const auto& unifiedBlobId : blobsToKeep) {
Y_VERIFY(unifiedBlobId.IsDsBlob(), "Not a DS blob id in Keep table: %s", unifiedBlobId.ToStringNew().c_str());
TLogoBlobID blobId = unifiedBlobId.GetLogoBlobId();
+ BlobsToKeep.insert(blobId);
+
+ // Keep + DontKeep (probably in different gen:steps)
+ // GC could go through it to a greater LastCollectedGenStep
+ if (BlobsToDelete.count(blobId)) {
+ continue;
+ }
+
TGenStep genStep{blobId.Generation(), blobId.Step()};
+ genStepsWithBlobsToKeep.insert(genStep);
Y_VERIFY(genStep > LastCollectedGenStep,
"Blob %s in keep queue is before last barrier (%" PRIu32 ":%" PRIu32 ")",
unifiedBlobId.ToStringNew().c_str(), std::get<0>(LastCollectedGenStep), std::get<1>(LastCollectedGenStep));
-
- genStepsWithBlobsToKeep.insert(genStep);
- BlobsToKeep.insert(blobId);
- }
-
- for (const auto& unifiedBlobId : blobsToDelete) {
- if (unifiedBlobId.IsSmallBlob()) {
- SmallBlobsToDelete.insert(unifiedBlobId);
- } else if (unifiedBlobId.IsDsBlob()) {
- BlobsToDelete.insert(unifiedBlobId.GetLogoBlobId());
- } else {
- Y_FAIL("Unexpected blob id: %s", unifiedBlobId.ToStringNew().c_str());
- }
}
AllocatedGenSteps.clear();