Skip to content

Commit d7e2fc4

Browse files
authored
Use explicit DirtyChunks in TCommitRecord (#14581)
1 parent a10a402 commit d7e2fc4

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

ydb/core/blobstorage/pdisk/blobstorage_pdisk.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ struct TCommitRecord {
2727
ui64 FirstLsnToKeep = 0; // 0 == not set
2828
TVector<TChunkIdx> CommitChunks;
2929
TVector<TChunkIdx> DeleteChunks;
30+
TVector<TChunkIdx> DirtyChunks;
3031
bool IsStartingPoint = false;
3132
bool DeleteToDecommitted = false; // 1 == set chunks to Decommitted state that requires a ChunkForget event or a restart
3233
// the value of DeleteToDecommitted is not stored as a part of the commit record.
@@ -74,6 +75,8 @@ struct TCommitRecord {
7475
PrintChunks(str, CommitChunks);
7576
str << " DeleteChunks# ";
7677
PrintChunks(str, DeleteChunks);
78+
str << " DirtyChunks# ";
79+
PrintChunks(str, DirtyChunks);
7780
str << "}";
7881
return str.Str();
7982
}

ydb/core/blobstorage/vdisk/hullop/blobstorage_hullcommit.h

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -128,17 +128,6 @@ namespace NKikimr {
128128
THullCommitFinished::TypeToString(NotifyType), CommitMsg->CommitRecord.ToString().data(),
129129
Metadata.RemovedHugeBlobs.ToString().data()));
130130

131-
// notify PDisk about dirty chunks (the ones from which huge slots are being freed right now)
132-
THashSet<TChunkIdx> chunkIds;
133-
for (const TDiskPart& p : Metadata.RemovedHugeBlobs) {
134-
chunkIds.insert(p.ChunkIdx);
135-
}
136-
if (chunkIds) {
137-
// TODO(alexvru): uncommit when PDisk stops breaking tests when this is enabled
138-
// ctx.Send(Ctx->PDiskCtx->PDiskId, new NPDisk::TEvMarkDirty(Ctx->PDiskCtx->Dsk->Owner,
139-
// Ctx->PDiskCtx->Dsk->OwnerRound, {chunkIds.begin(), chunkIds.end()}));
140-
}
141-
142131
ctx.Send(Ctx->LoggerId, CommitMsg.release());
143132
}
144133

@@ -253,6 +242,13 @@ namespace NKikimr {
253242
CommitRecord.DeleteChunks = std::move(Metadata.DeleteChunks);
254243
CommitRecord.DeleteToDecommitted = Metadata.DeleteToDecommitted;
255244

245+
// notify PDisk about dirty chunks (the ones from which huge slots are being freed right now)
246+
THashSet<TChunkIdx> chunkIds;
247+
for (const TDiskPart& p : Metadata.RemovedHugeBlobs) {
248+
chunkIds.insert(p.ChunkIdx);
249+
}
250+
CommitRecord.DirtyChunks = {chunkIds.begin(), chunkIds.end()};
251+
256252
// validate its contents
257253
VerifyCommitRecord(CommitRecord);
258254
VerifyRemovedHugeBlobs(Metadata.RemovedHugeBlobs);

0 commit comments

Comments
 (0)