Skip to content

Commit

Permalink
[+] commments
Browse files Browse the repository at this point in the history
  • Loading branch information
Alek5andr-Kotov committed Feb 5, 2025
1 parent dfcb858 commit 6819cdf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions ydb/core/persqueue/partition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3402,6 +3402,7 @@ void TPartition::ScheduleUpdateAvailableSize(const TActorContext& ctx) {
void TPartition::ClearOldHead(const ui64 offset, const ui16 partNo, TEvKeyValue::TEvRequest* request) {
for (auto it = HeadKeys.rbegin(); it != HeadKeys.rend(); ++it) {
if (it->Key.GetOffset() > offset || it->Key.GetOffset() == offset && it->Key.GetPartNo() >= partNo) {
// The repackaged blocks will be deleted after writing.
DefferedKeysForDeletion.push_back(std::move(it->BlobKeyToken));

Y_UNUSED(request);
Expand Down
3 changes: 3 additions & 0 deletions ydb/core/persqueue/partition_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,9 @@ void TInitDataRangeStep::FillBlobsMetaData(const NKikimrClient::TKeyValueRespons
auto& gapSize = Partition()->GapSize;
auto& bodySize = Partition()->BodySize;

// If there are multiple keys for a message, then only the key that contains more messages remains.
//
// Extra keys will be added to the queue for deletion.
const auto actualKeys = FilterBlobsMetaData(range,
PartitionId());

Expand Down
1 change: 1 addition & 0 deletions ydb/core/persqueue/partition_write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ void TPartition::SyncMemoryStateWithKVState(const TActorContext& ctx) {
HeadKeys.clear();
}

// New blocks have been recorded. You can now delete the keys of the repackaged blocks.
DefferedKeysForDeletion.clear();

if (NewHeadKey.Size > 0) {
Expand Down

0 comments on commit 6819cdf

Please sign in to comment.