-
Notifications
You must be signed in to change notification settings - Fork 589
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
[v23.1.x] Fix txn consume group issues leading to undefined behavior #12006
Merged
rystsov
merged 9 commits into
redpanda-data:v23.1.x
from
rystsov:backport-pr-11110-11474-11621-v23.1.x
Jul 18, 2023
Merged
[v23.1.x] Fix txn consume group issues leading to undefined behavior #12006
rystsov
merged 9 commits into
redpanda-data:v23.1.x
from
rystsov:backport-pr-11110-11474-11621-v23.1.x
Jul 18, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(cherry picked from commit 7debd01)
An execution of abort_old_txes could span multiple terms so the so the method could modify new state assuming it's the old state resulting in undefined behavior (cherry picked from commit f7fc026)
Make group accept term to reduce scope of where reset_tx_state is used to easier track where the write lock is necessary (cherry picked from commit 93297d5)
rystsov
added
kind/backport
PRs targeting a stable branch
and removed
area/redpanda
labels
Jul 10, 2023
When the consumer group log's term change we replay the whole log to reconstruct the state. We used to merge current and the replayed state but it's error prone. Reseting the whole txn state to have more deter- ministic behavior (cherry picked from commit 69c5392)
Transactions in kafka protocol are stateful: the processing of the requests depends on the previous commands executed by the same or even different producer. It makes the situations when the replica- tion fails with the indecisive errors such as timeout dangerous because the true state is unknown. Stepping down to resolve uncertainty by replaying the log (cherry picked from commit 7ca5707)
Fixes: - redpanda-data#11372 - redpanda-data#11452 - redpanda-data#11344 This reverts commit f7fc026. (cherry picked from commit 6d86fc8)
(cherry picked from commit 0dabdff)
(cherry picked from commit 45675cc)
An execution of abort_old_txes could span multiple terms so the so the method could modify new state assuming it's the old state resulting in undefined behavior. This commit is the rewrite of the reverted f7fc026 in 11474. The pro- blem was caused by: - do_detach_partition got blocked - RP ignored blocked do_detach_partition and attempted next op leading double registration of the consumer groups ntp The op was blocked by a deadlock: - do_abort_old_txes was waiting for read lock while holding _gate - do_detach_partition was holding write lock while waiting to the gate to be closed This version doesn't wait for the read lock to become available and exit do_abort_old_txes releasing the _gate. It still isn't clear why RP ignored a blocked op (cherry picked from commit 0b9b9fb)
rystsov
force-pushed
the
backport-pr-11110-11474-11621-v23.1.x
branch
from
July 10, 2023 21:58
db27de2
to
15f575f
Compare
mmaslankaprv
approved these changes
Jul 14, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport of PRs:
abort_old_txes
of the consumer group to use locks #11621Fixes #11481
Fixes #11990