diff options
author | serg-belyakov <serg-belyakov@yandex-team.com> | 2023-03-22 14:56:24 +0300 |
---|---|---|
committer | serg-belyakov <serg-belyakov@yandex-team.com> | 2023-03-22 14:56:24 +0300 |
commit | 7a9fc04ac03274fc8f3b4783ed6bd806c0436415 (patch) | |
tree | fd3fa62b94ee590bb82a96e403170c8f7c8ff7db | |
parent | 146e4d4169bc8f571c0c7f4262885ae0d830861c (diff) | |
download | ydb-7a9fc04ac03274fc8f3b4783ed6bd806c0436415.tar.gz |
Fix garbage collection barrier tracking in blob depot UT,
Fix collect barrier tracking logic
Remove redundant assert in UT
-rw-r--r-- | ydb/core/blobstorage/ut_blobstorage/blob_depot_event_managers.cpp | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/ydb/core/blobstorage/ut_blobstorage/blob_depot_event_managers.cpp b/ydb/core/blobstorage/ut_blobstorage/blob_depot_event_managers.cpp index 603d904b7b..40ee0dbadb 100644 --- a/ydb/core/blobstorage/ut_blobstorage/blob_depot_event_managers.cpp +++ b/ydb/core/blobstorage/ut_blobstorage/blob_depot_event_managers.cpp @@ -538,28 +538,15 @@ void VerifyTEvCollectGarbageResult(TAutoPtr<TEventHandleFat<TEvBlobStorage::TEvC UNIT_ASSERT_VALUES_EQUAL(status, NKikimrProto::BLOCKED); } } else { - if (collect) { + if (status == NKikimrProto::OK) { if (hard) { - if (collectGeneration < hardCollectGen || (collectGeneration == hardCollectGen && collectStep < hardCollectStep)) { - UNIT_ASSERT_VALUES_UNEQUAL(status, NKikimrProto::OK); - } + hardCollectGen = std::max(hardCollectGen, collectGeneration); + hardCollectStep = std::max(hardCollectStep, collectStep); } else { - if (collectGeneration < softCollectGen || (collectGeneration == softCollectGen && collectStep < softCollectStep)) { - UNIT_ASSERT_VALUES_UNEQUAL(status, NKikimrProto::OK); - } + softCollectGen = std::max(softCollectGen, collectGeneration); + softCollectStep = std::max(softCollectStep, collectStep); } - } - if (status == NKikimrProto::OK) { - if (collect) { - if (hard) { - hardCollectGen = collectGeneration; - hardCollectStep = collectStep; - } else { - softCollectGen = collectGeneration; - softCollectStep = collectStep; - } - } for (auto& blob : blobs) { if (keep) { if (setKeep.find(blob.Id) != setKeep.end()) { @@ -573,7 +560,7 @@ void VerifyTEvCollectGarbageResult(TAutoPtr<TEventHandleFat<TEvBlobStorage::TEvC } if ((blob.Status == TBlobInfo::EStatus::WRITTEN) && (blob.Id.TabletID() == tabletId) && (blob.Id.Channel() == channel) && - IsCollected(blob, softCollectGen, softCollectStep, hardCollectGen, hardCollectStep)) { + (hard || collect) && IsCollected(blob, softCollectGen, softCollectStep, hardCollectGen, hardCollectStep)) { blob.Status = TBlobInfo::EStatus::COLLECTED; } } |