-
Notifications
You must be signed in to change notification settings - Fork 727
Fix the notify about commit logic in Column Shards #27104
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
Fix the notify about commit logic in Column Shards #27104
Conversation
🟢 |
⚪ |
⚪ |
⚪ ⚪ Ya make output | Test bloat | Test bloat
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
⚪
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Fixes the “notify about commit” logic in Column Shards by clarifying lock-vs-tx semantics and ensuring commits of conflicting locks correctly trigger breaking and notifications.
- Distinguishes “maybe conflicting writes” from confirmed “conflicting writes” in TReadMetadata and wires them into the read lifecycle.
- Corrects AddEventForLock to handle cases where a conflicting lock may already be committed.
- Renames txId-centric interfaces to lockId across interactions, readers, and event writers for clarity.
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
ydb/core/tx/columnshard/transactions/locks/write.h | Switches interactions from txId to lockId; conflicts now map “selfLockId commits → others break”. |
ydb/core/tx/columnshard/transactions/locks/read_start.h | Renames interaction method params to lockId; notification wiring for maybe-conflicting locks. |
ydb/core/tx/columnshard/transactions/locks/read_start.cpp | Applies lockId naming and interval registration on add/remove. |
ydb/core/tx/columnshard/transactions/locks/read_finished.h | Signature updated to lockId naming; behavior unchanged. |
ydb/core/tx/columnshard/transactions/locks/interaction.h | Renames API to GetAffectedLockIds and aligns interval add/remove with lockId naming. |
ydb/core/tx/columnshard/transactions/locks/abstract.h | Updates ITxEvent/ITxEventWriter interfaces from txId to lockId; event container now keyed by LockId. |
ydb/core/tx/columnshard/operations/manager.h | Renames BrokeOnCommit → BreakOnCommit; adjusts commit notification API. |
ydb/core/tx/columnshard/operations/manager.cpp | Fixes commit-handling logic; breaks conflicting locks and delivers commit notifications consistently. |
ydb/core/tx/columnshard/engines/reader/simple_reader/iterator/source.cpp | Adapts to new read metadata methods (SetBreakLockOnReadFinished, SetWriteConflicting). |
ydb/core/tx/columnshard/engines/reader/plain_reader/iterator/source.cpp | Same as above for plain reader. |
ydb/core/tx/columnshard/engines/reader/common_reader/constructor/read_metadata.h | Introduces maybe vs confirmed conflicting writes; renames and reorganizes counters/APIs. |
ydb/core/tx/columnshard/engines/reader/common_reader/constructor/read_metadata.cpp | Wires maybe-conflicting lock IDs into pre-read, and confirmed conflicts into post-read logic. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
ydb/core/tx/columnshard/engines/reader/common_reader/constructor/read_metadata.h
Show resolved
Hide resolved
⚪ ⚪ Ya make output | Test bloat | Test bloat
⚪ Ya make output | Test bloat | Test bloat | Test bloat
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
⚪
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
⚪ ⚪ Ya make output | Test bloat | Test bloat
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
|
||
private: | ||
std::shared_ptr<TAtomicCounter> BrokenWithCommitted = std::make_shared<TAtomicCounter>(); | ||
mutable TAtomicCounter BreakLockOnReadFinished = TAtomicCounter(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mutable? Из-за избавления от shared_ptr?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Так точно. Там метод который это поле меняет const, и на этот const там полагаются вызывающие методы и т.д. В общем, я не стал все это править, просто локально упростил. shared_ptr убрал т.к. это внутренняя переменная, никуда мы ее не шарим, а сам класс не копируемый.
} | ||
THashSet<ui64> GetConflictableLockIds() const { | ||
|
||
void SetBreakLockOnReadFinished() const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А почему не Add или Inc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ну оно по смыслу не Add. Мы именно просим «сломай свой лок когда закончится чтение».
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
То что оно там add внутри - это детали реализации, не вижу смысла «показывать» их наружу.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Странно выглядит, что на самом деле это не Set
Fixes #26463
There is some renaming. It does not fixes the logic but makes it much easier to understand and harder to make a mistake.
The actual fix is in: