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
KAFKA-15690: Fix restoring tasks on partition loss, flaky EosIntegrationTest #14869
Merged
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
lucasbru
force-pushed
the
fix_flaky_eos
branch
from
November 30, 2023 09:55
afc65d0
to
0a7cf02
Compare
lucasbru
changed the title
KAFKA-15690: Fix restoring task handling on partition loss, flaky Eos…
KAFKA-15690: Fix restoring tasks on partition loss, flaky EosIntegrationTest
Nov 30, 2023
cadonna
approved these changes
Nov 30, 2023
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.
Thanks for the fix, @lucasbru !
LGTM!
ex172000
pushed a commit
to ex172000/kafka
that referenced
this pull request
Dec 15, 2023
…ionTest (apache#14869) The following race can happen in the state updater code path Task is restoring, owned by state updater We fall out of the consumer group, lose all partitions We therefore register a "TaskManager.pendingUpdateAction", to CLOSE_DIRTY We also register a "StateUpdater.taskAndAction" to remove the task We get the same task reassigned. Since it's still owned by the state updater, we don't do much The task completes restoration The "StateUpdater.taskAndAction" to remove will be ignored, since it's already restored Inside "handleRestoredTasksFromStateUpdater", we close the task dirty because of the pending update action We now have the task assigned, but it's closed. To fix this particular race, we cancel the "close" pending update action. Furthermore, since we may have made progress in other threads during the missed rebalance, we need to add the task back to the state updater, to at least check if we are still at the end of the changelog. Finally, it seems we do not need to close dirty here, it's enough to close clean when we lose the task, related to KAFKA-10532. This should fix the flaky EOSIntegrationTest. Reviewers: Bruno Cadonna <cadonna@apache.org>
yyu1993
pushed a commit
to yyu1993/kafka
that referenced
this pull request
Feb 15, 2024
…ionTest (apache#14869) The following race can happen in the state updater code path Task is restoring, owned by state updater We fall out of the consumer group, lose all partitions We therefore register a "TaskManager.pendingUpdateAction", to CLOSE_DIRTY We also register a "StateUpdater.taskAndAction" to remove the task We get the same task reassigned. Since it's still owned by the state updater, we don't do much The task completes restoration The "StateUpdater.taskAndAction" to remove will be ignored, since it's already restored Inside "handleRestoredTasksFromStateUpdater", we close the task dirty because of the pending update action We now have the task assigned, but it's closed. To fix this particular race, we cancel the "close" pending update action. Furthermore, since we may have made progress in other threads during the missed rebalance, we need to add the task back to the state updater, to at least check if we are still at the end of the changelog. Finally, it seems we do not need to close dirty here, it's enough to close clean when we lose the task, related to KAFKA-10532. This should fix the flaky EOSIntegrationTest. Reviewers: Bruno Cadonna <cadonna@apache.org>
AnatolyPopov
pushed a commit
to aiven/kafka
that referenced
this pull request
Feb 16, 2024
…ionTest (apache#14869) The following race can happen in the state updater code path Task is restoring, owned by state updater We fall out of the consumer group, lose all partitions We therefore register a "TaskManager.pendingUpdateAction", to CLOSE_DIRTY We also register a "StateUpdater.taskAndAction" to remove the task We get the same task reassigned. Since it's still owned by the state updater, we don't do much The task completes restoration The "StateUpdater.taskAndAction" to remove will be ignored, since it's already restored Inside "handleRestoredTasksFromStateUpdater", we close the task dirty because of the pending update action We now have the task assigned, but it's closed. To fix this particular race, we cancel the "close" pending update action. Furthermore, since we may have made progress in other threads during the missed rebalance, we need to add the task back to the state updater, to at least check if we are still at the end of the changelog. Finally, it seems we do not need to close dirty here, it's enough to close clean when we lose the task, related to KAFKA-10532. This should fix the flaky EOSIntegrationTest. Reviewers: Bruno Cadonna <cadonna@apache.org>
clolov
pushed a commit
to clolov/kafka
that referenced
this pull request
Apr 5, 2024
…ionTest (apache#14869) The following race can happen in the state updater code path Task is restoring, owned by state updater We fall out of the consumer group, lose all partitions We therefore register a "TaskManager.pendingUpdateAction", to CLOSE_DIRTY We also register a "StateUpdater.taskAndAction" to remove the task We get the same task reassigned. Since it's still owned by the state updater, we don't do much The task completes restoration The "StateUpdater.taskAndAction" to remove will be ignored, since it's already restored Inside "handleRestoredTasksFromStateUpdater", we close the task dirty because of the pending update action We now have the task assigned, but it's closed. To fix this particular race, we cancel the "close" pending update action. Furthermore, since we may have made progress in other threads during the missed rebalance, we need to add the task back to the state updater, to at least check if we are still at the end of the changelog. Finally, it seems we do not need to close dirty here, it's enough to close clean when we lose the task, related to KAFKA-10532. This should fix the flaky EOSIntegrationTest. Reviewers: Bruno Cadonna <cadonna@apache.org>
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.
The following race can happen in the state updater code path
To fix this particular race, we cancel the "close" pending update action. Furthermore, since we may have made progress in other threads during the missed rebalance, we need to add the task back to the state updater, to at least check if we are still at the end of the changelog. Finally, it seems we do not need to close dirty here, it's enough to close clean when we lose the task, related to KAFKA-10532.
This should fix the flaky EOSIntegrationTest.
Committer Checklist (excluded from commit message)