Skip to content

issue-5590: split flushed blobs by compaction range borders#5884

Open
vladstepanyuk wants to merge 6 commits intomainfrom
users/vladstepanyuk/issue-5590/split-blobs-by-compaction-range-borders/0
Open

issue-5590: split flushed blobs by compaction range borders#5884
vladstepanyuk wants to merge 6 commits intomainfrom
users/vladstepanyuk/issue-5590/split-blobs-by-compaction-range-borders/0

Conversation

@vladstepanyuk
Copy link
Copy Markdown
Collaborator

Notes

When flushing fresh blocks into mixed blobs, if the number of distinct compaction ranges in a candidate blob does not exceed SplitByCompactionRangeMaxBlobCount value, the blob may be split at compaction range borders to eliminate reading block masks for such blobs. Zero disables splitting.

Issue

#5590

@vladstepanyuk vladstepanyuk added large-tests Launch large tests for PR blockstore Add this label to run only cloud/blockstore build and tests on PR need_ai_review labels May 4, 2026
Comment thread cloud/blockstore/libs/storage/partition/part_actor_flush.cpp Outdated
Comment thread cloud/blockstore/libs/storage/partition/part_actor_flush.cpp Outdated
Comment thread cloud/blockstore/libs/storage/partition/part_actor_flush.cpp Outdated
Copy link
Copy Markdown

@robot-vibe-db robot-vibe-db Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI Review Summary

Verdict: ✅ No critical issues found

Critical issues

No critical issues found.

Other findings

  • Minor | High: Y_DEBUG_ABORT_UNLESS assertion is too strict — will fire for data blobs when DiskPrefixLengthWithBlockChecksumsInBlobs is 0 (default), since checksums is empty but dataRefs is non-empty — part_actor_flush.cpp:621
  • Nit | High: const ui64 compactionRangeCount in AppendDataBlob stores a ui8 return value and implicitly narrows it back to ui8 when passed to TBlob constructor — part_actor_flush.cpp:575
  • Nit | Low: CountCompactionRangeCountWithSplitOptimization counts distinct contiguous range runs while CountCompactionRangeCount counts the range index span — names don't convey this difference clearly — part_actor_flush.cpp:538

This review was generated automatically. Critical issues require attention; other findings are advisory.
If this comment was useful, please give it a 👍 — it helps us improve the review bot.

Comment thread cloud/blockstore/libs/storage/partition/part_actor_flush.cpp Outdated
Comment thread cloud/blockstore/libs/storage/partition/part_actor_flush.cpp Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 4, 2026

Note

This is an automated comment that will be appended during run.

🟢 linux-x86_64-relwithdebinfo target: cloud/blockstore/ (test time: 11410s): all tests PASSED for commit d478286.

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
6530 6529 0 0 0 1 0

Comment thread cloud/blockstore/libs/storage/partition/part_actor_flush.cpp Outdated
FlushBlob({}, std::move(blocks), {});
}

void FlushBlob(
Copy link
Copy Markdown
Collaborator

@qkrorlqr qkrorlqr May 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO it will be better to extract the declaration of this func into a header and write unittests directly for this func

better both from the test coverage point of view and from the test runtime point of view (tablet tests are much heavier than what's actually required to test this func)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved flush blocks visitor to partition/model

Comment thread cloud/blockstore/libs/storage/partition/part_actor_flush.cpp Outdated
Comment thread cloud/blockstore/libs/storage/partition/part_actor_flush.cpp Outdated
const TVector<TBlock>& blocks) const
{
ui32 ranges = 1;
for (size_t i = 1; i < blocks.size(); ++i) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Также, я бы сюда передал SplitByCompactionRangeMaxBlobCount и ограничил цикл по нему. Для рандомной нагрузки по 4k тут же сотни диапазонов могут быть?

Copy link
Copy Markdown
Collaborator Author

@vladstepanyuk vladstepanyuk May 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ну тут больше 1024 блоков и 32 диапазона не может быть, для рандомной нагрузки 4к в нынешней картине это итерация по двум элементам

Comment thread cloud/blockstore/libs/storage/partition/part_actor_flush.cpp Outdated
@komarevtsev-d komarevtsev-d self-requested a review May 4, 2026 15:55
@vladstepanyuk vladstepanyuk force-pushed the users/vladstepanyuk/issue-5590/split-blobs-by-compaction-range-borders/0 branch from eb54401 to 1924294 Compare May 7, 2026 08:04
@vladstepanyuk vladstepanyuk requested a review from qkrorlqr May 7, 2026 08:04
Comment thread cloud/blockstore/libs/storage/partition/model/flush_blocks_visitor.cpp Outdated
Comment thread cloud/blockstore/libs/storage/partition/model/flush_blocks_visitor.cpp Outdated
Comment thread cloud/blockstore/libs/storage/partition/model/flush_blocks_visitor.cpp Outdated
}

template <typename TTmpContainerType>
void TFlushBlocksVisitor::FlushBlobImpl(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А FlushBlobImpl точно нужен шаблонный? Решение о типе внутри нельзя принять и передать уже в шаблон SplitBlocksByCompactionRangeBorders?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не принципиально особо, просто странно смотрится что мы туда передаём шаблонный тип, но он не используется ни в аргументах этой фуникци, ни в return type

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нам же надо объявить переменную либо с одним типом либом с другим, поэтому если внутри функции это решать, то надо будет весь код после объявления перемнной запихать под if constexpr

ну или с макросами лямбдами развлекаться

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

Note

This is an automated comment that will be appended during run.

🟢 linux-x86_64-relwithdebinfo target: cloud/blockstore/ (test time: 11415s): all tests PASSED for commit a8613fe.

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
6552 6551 0 0 0 1 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai_reviewed blockstore Add this label to run only cloud/blockstore build and tests on PR large-tests Launch large tests for PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants