Skip to content

Commit

Permalink
Merge #6398 #6405 from main into stable-24-2 (#6446)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexvru authored Jul 9, 2024
1 parent 979d449 commit 640af98
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 2 deletions.
22 changes: 22 additions & 0 deletions ydb/core/blobstorage/ut_blobstorage/gc.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include <ydb/core/blobstorage/ut_blobstorage/lib/env.h>

Y_UNIT_TEST_SUITE(GarbageCollection) {
Y_UNIT_TEST(EmptyGcCmd) {
TEnvironmentSetup env({
.Erasure = TBlobStorageGroupType::Erasure4Plus2Block,
});
auto& runtime = env.Runtime;

env.CreateBoxAndPool(1, 1);
auto info = env.GetGroupInfo(env.GetGroups().front());

auto ev = std::make_unique<TEvBlobStorage::TEvCollectGarbage>(1u, 1u, 1u, 0u, false, 0u, 0u, nullptr, nullptr,
TInstant::Max(), true);
const TActorId edge = runtime->AllocateEdgeActor(1, __FILE__, __LINE__);
runtime->WrapInActorContext(edge, [&] {
SendToBSProxy(edge, info->GroupID, ev.release());
});
auto res = env.WaitForEdgeActorEvent<TEvBlobStorage::TEvCollectGarbageResult>(edge);
UNIT_ASSERT_VALUES_EQUAL(res->Get()->Status, NKikimrProto::ERROR);
}
}
1 change: 1 addition & 0 deletions ydb/core/blobstorage/ut_blobstorage/ya.make
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ SRCS(
defrag.cpp
encryption.cpp
extra_block_checks.cpp
gc.cpp
gc_quorum_3dc.cpp
group_reconfiguration.cpp
incorrect_queries.cpp
Expand Down
7 changes: 7 additions & 0 deletions ydb/core/blobstorage/vdisk/hullop/blobstorage_hull.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,13 @@ namespace NKikimr {
if (!CheckGC(ctx, record))
return {NKikimrProto::ERROR, 0, false}; // record has duplicates

if (!collect && !record.KeepSize() && !record.DoNotKeepSize()) {
LOG_ERROR_S(ctx, NKikimrServices::BS_HULLRECS, HullDs->HullCtx->VCtx->VDiskLogPrefix
<< "Db# Barriers ValidateGCCmd: empty garbage collection command"
<< " TabletId# " << tabletID);
return {NKikimrProto::ERROR, "empty garbage collection command"};
}

auto blockStatus = THullDbRecovery::IsBlocked(record);
switch (blockStatus.Status) {
case TBlocksCache::EStatus::OK:
Expand Down
4 changes: 2 additions & 2 deletions ydb/core/blobstorage/vdisk/repl/blobstorage_repl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,8 @@ namespace NKikimr {
// no more blobs to replicate; replication will not resume
State = Finished;
ReplCtx->MonGroup.ReplUnreplicatedVDisks() = 0;
ReplCtx->MonGroup.ReplUnreplicatedPhantoms() = 1;
ReplCtx->MonGroup.ReplUnreplicatedNonPhantoms() = 1;
ReplCtx->MonGroup.ReplUnreplicatedPhantoms() = 0;
ReplCtx->MonGroup.ReplUnreplicatedNonPhantoms() = 0;
ReplCtx->MonGroup.ReplWorkUnitsRemaining() = 0;
ReplCtx->MonGroup.ReplWorkUnitsDone() = 0;
ReplCtx->MonGroup.ReplItemsRemaining() = 0;
Expand Down

0 comments on commit 640af98

Please sign in to comment.