Skip to content
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 partial distributed commit of uncommitted changes during shard restart race #2169

Conversation

snaury
Copy link
Member

@snaury snaury commented Feb 22, 2024

Changelog entry

Fix partial distributed commit of uncommitted changes during shard restart race.

Changelog category

  • Bugfix

Additional information

A rare G0 anomaly was detected with Jepsen, which corresponded to a partial commit of accumulated changes when using persistent distributed transactions. Investigation showed that the Frozen lock flag was not persisted (this flag is set for write locks when they are validated and outgoing readsets are generated, and used to protect lock changes until transaction decides to commit or abort based on other participant decisions), and there was a window after a given shard restarts and before it fully restores the pipeline dependencies (including Frozen flag for locks validated in previous generations). During this time window lock subscription may report lock as unavailable or expired (e.g. when transaction is fully removed from a KQP session, either due to implicit rollback also failing quickly due to shard unavailability, or node restarting and losing all state). This in turn rolled back (previously frozen) lock changes, when they should have been committed instead.

Fixes KIKIMR-21088. Ported to 24-1 from #2148.

@snaury snaury marked this pull request as ready for review February 22, 2024 09:34
@snaury snaury requested a review from a team as a code owner February 22, 2024 09:34
Copy link

github-actions bot commented Feb 22, 2024

2024-02-22 09:34:43 UTC Pre-commit check for e0ad375 has started.
2024-02-22 09:34:46 UTC Build linux-x86_64-relwithdebinfo is running...
🟢 2024-02-22 09:40:01 UTC Build successful.
2024-02-22 09:40:17 UTC Tests are running...
🟢 2024-02-22 10:50:59 UTC Tests successful.

Test history

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
60361 50935 0 0 9340 86

Copy link

github-actions bot commented Feb 22, 2024

2024-02-22 09:34:45 UTC Pre-commit check for e0ad375 has started.
2024-02-22 09:34:48 UTC Build linux-x86_64-release-asan is running...
🟢 2024-02-22 09:40:08 UTC Build successful.
2024-02-22 09:40:31 UTC Tests are running...
🔴 2024-02-22 11:15:46 UTC Some tests failed, follow the links below.

Test history

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
16020 15918 0 17 53 32

@snaury snaury merged commit 14c6dfb into ydb-platform:stable-24-1 Feb 22, 2024
3 of 4 checks passed
@snaury snaury deleted the cherry-pick-24-1-d32315a4015f3a5c5d8ff5f93a62779456c5e55c branch February 22, 2024 17:18
@mregrock mregrock mentioned this pull request May 15, 2024
This was referenced Jun 7, 2024
@CyberROFL CyberROFL mentioned this pull request Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants