Skip to content

Fix Defragmentation::DoesItWork unit test #1531

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/config/muted_ya.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ ydb/core/blobstorage/dsproxy/ut_fat TBlobStorageProxyTest.TestBatchedPutRequestD
ydb/core/blobstorage/pdisk/ut TSectorMap.*
ydb/core/blobstorage/ut_blobstorage/ut_read_only_vdisk ReadOnlyVDisk.TestStorageLoad
ydb/core/blobstorage/ut_blobstorage CostMetricsGetBlock4Plus2.TestGet4Plus2BlockRequests10000Inflight1BlobSize1000
ydb/core/blobstorage/ut_blobstorage Defragmentation.DoesItWork
ydb/core/blobstorage/ut_blobstorage SpaceCheckForDiskReassign.*
ydb/core/blobstorage/ut_blobstorage ScrubFast.SingleBlob
ydb/core/blobstorage/ut_blobstorage VDiskAssimilation.Test
Expand Down
30 changes: 5 additions & 25 deletions ydb/core/blobstorage/ut_blobstorage/defrag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,7 @@ static TIntrusivePtr<TBlobStorageGroupInfo> PrepareEnv(TEnvironmentSetup& env, T

for (;;) {
const TLogoBlobID id(1, 1, index /*step*/, 0, data.size(), 0);
const ui32 hash = id.FullID().Hash();
if (!info->GetTopology().BelongsToSubgroup(vdiskId, hash)) {
continue;
}
const ui32 idxInSubgroup = info->GetTopology().GetIdxInSubgroup(vdiskId, hash);
const ui32 partIdx = idxInSubgroup & 1; // 0 1 0 1 01 01 01 01 possible layouts; this fits them
env.PutBlob(vdiskId, TLogoBlobID(id, partIdx + 1), data);
env.PutBlob(vdiskId, TLogoBlobID(id, 1), data);
++index;

env.Sim();
Expand Down Expand Up @@ -68,13 +62,6 @@ static TIntrusivePtr<TBlobStorageGroupInfo> PrepareEnv(TEnvironmentSetup& env, T
// wait for sync
env.Sim(TDuration::Seconds(3));

// partition
for (const ui32 node : env.Runtime->GetNodes()) {
env.StopNode(node);
}
env.StartNode(actorId.NodeId());
env.Sim(TDuration::Seconds(20));

for (;;) {
// trigger compaction
{
Expand Down Expand Up @@ -115,8 +102,8 @@ static TIntrusivePtr<TBlobStorageGroupInfo> PrepareEnv(TEnvironmentSetup& env, T
Y_UNIT_TEST_SUITE(Defragmentation) {
Y_UNIT_TEST(DoesItWork) {
TEnvironmentSetup env(TEnvironmentSetup::TSettings{
.NodeCount = 8,
.Erasure = TBlobStorageGroupType::ErasureMirror3of4,
.NodeCount = 1,
.Erasure = TBlobStorageGroupType::ErasureNone,
});

TVector<TLogoBlobID> keep;
Expand Down Expand Up @@ -150,8 +137,8 @@ Y_UNIT_TEST_SUITE(Defragmentation) {

Y_UNIT_TEST(DefragCompactionRace) {
TEnvironmentSetup env(TEnvironmentSetup::TSettings{
.NodeCount = 8,
.Erasure = TBlobStorageGroupType::ErasureMirror3of4,
.NodeCount = 1,
.Erasure = TBlobStorageGroupType::ErasureNone,
});

TVector<TLogoBlobID> keep;
Expand Down Expand Up @@ -179,13 +166,6 @@ Y_UNIT_TEST_SUITE(Defragmentation) {
env.Sim(TDuration::Minutes(1));
}

// unpartition
for (const ui32 node : env.Runtime->GetNodes()) {
if (node != actorId.NodeId()) {
env.StartNode(node);
}
}

// issue collect garbage command
{
const TActorId& sender = env.Runtime->AllocateEdgeActor(1);
Expand Down