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 volatile result sent before it is fully committed #2598

Merged

Conversation

snaury
Copy link
Member

@snaury snaury commented Mar 11, 2024

Changelog entry

Fix volatile result sent before it is fully committed.

Changelog category

  • Bugfix

Additional information

A rare failure was detected with Jepsen when volatile transactions feature is enabled and used. Investigation showed that YDB would sometimes reply SUCCESS to a commit that has actually failed. The underlying issue is that since volatile transactions are prepared in-memory, a PREPARED reply is sent very early in the pipeline, before the (readonly) propose transaction is committed (which is expected, volatile transactions don't have storage in their critical path until they are executed). When storage is a bit slow the volatile transaction may be fast enough to plan and execute while a previous localdb transaction is still committing. When propose localdb transaction finally commits it would erroneously observe the new operation result (which optimistically has SUCCESS while it is waiting for localdb commit and other participants), and would send it thinking this is a propose phase result. The localdb commit with execution side effects may fail however, but the SUCCESS result has already been sent by that time. This is fixed by marking operations that send propose result early, and ignoring operation result on propose completion in such operations.

Fixes KIKIMR-21156.

Verified

This commit was signed with the committer’s verified signature.
j-f1 Jed Fox
Copy link

github-actions bot commented Mar 11, 2024

2024-03-11 10:36:44 UTC Pre-commit check for 286bf8d has started.
2024-03-11 10:36:47 UTC Build linux-x86_64-release-asan is running...
🟢 2024-03-11 10:42:25 UTC Build successful.
2024-03-11 10:42:40 UTC Tests are running...
🔴 2024-03-11 12:40:41 UTC Some tests failed, follow the links below.

Test history

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
15012 14431 0 67 486 28

Copy link

github-actions bot commented Mar 11, 2024

2024-03-11 10:36:51 UTC Pre-commit check for 286bf8d has started.
2024-03-11 10:36:54 UTC Build linux-x86_64-release-cmake14 is running...
🟢 2024-03-11 10:41:44 UTC Build successful.

Copy link

github-actions bot commented Mar 11, 2024

2024-03-11 10:44:20 UTC Pre-commit check for 286bf8d has started.
2024-03-11 10:44:21 UTC Build linux-x86_64-relwithdebinfo is running...
🟢 2024-03-11 10:49:38 UTC Build successful.
2024-03-11 10:49:47 UTC Tests are running...
🔴 2024-03-11 12:31:00 UTC Some tests failed, follow the links below.

Test history

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
68294 57342 0 10 10922 20

@snaury snaury marked this pull request as ready for review March 11, 2024 12:32
@snaury snaury requested a review from azevaykin March 11, 2024 12:32
@snaury snaury merged commit 4494ea7 into ydb-platform:main Mar 11, 2024
4 of 6 checks passed
@snaury snaury deleted the KIKIMR-21156-fix-early-volatile-reply branch March 11, 2024 13:32
snaury added a commit to snaury/ydb that referenced this pull request Mar 11, 2024

Verified

This commit was signed with the committer’s verified signature.
j-f1 Jed Fox
)
@snaury snaury self-assigned this Mar 11, 2024
@shnikd shnikd mentioned this pull request Mar 26, 2024
This was referenced Mar 29, 2024
@shnikd shnikd mentioned this pull request Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants