Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -22,6 +22,7 @@ SRCS(
ds_proxy_lwtrace.cpp
encryption.cpp
extra_block_checks.cpp
gc.cpp
gc_quorum_3dc.cpp
get.cpp
group_reconfiguration.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 @@ -413,6 +413,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 @@ -425,8 +425,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