-
Notifications
You must be signed in to change notification settings - Fork 15.4k
KAFKA-8755: Fix state restore for standby tasks with optimized topology #7238
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
Changes from all commits
e468587
3d92400
1f8a06b
390606c
7a18866
0b14fbd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,4 +24,14 @@ class AssignedStandbyTasks extends AssignedTasks<StandbyTask> { | |
| super(logContext, "standby task"); | ||
| } | ||
|
|
||
| @Override | ||
| int commit() { | ||
| final int committed = super.commit(); | ||
| // TODO: this contortion would not be necessary if we got rid of the two-step | ||
| // task.commitNeeded and task.commit and instead just had task.commitIfNeeded. Currently | ||
| // we only call commit if commitNeeded is true, which means that we need a way to indicate | ||
| // that we are eligible for updating the offset limit outside of commit. | ||
| running.forEach((id, task) -> task.allowUpdateOfOffsetLimit()); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems we should add
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could add a test here, but it is super implementation specific. This is not really the best home for the code, just the most convenient at the moment. All we would test, I think, is that we called allowUpdateOfOffsetLimit? The integration test covers this in a more comprehensive way and doesn't break when we move this code. What do you think?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes, the test should be
"and doesn't break" -- I guess it should break? The main purpose of the unit test is, that is would be hard to debug the integration test and figure out the root cause why it fails.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added back the StandbyTask tests that will cover this with a much more narrow test - specifically to cover when to update the offset limit. If this gets moved into StandbyTask that test should not fail, provided it was done right. If it's broken in any way that test will flag it and it should be easy to look at the test failure and the changed code to determine the cause. Do you think StandbyTaskTest sufficiently addresses your concern? |
||
| return committed; | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.
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.
@guozhangwang With regard to you comment about exceptions for EOS -- it seem only relevant to catch and swallow a
TimeoutExceptionhere? Or should the caller be responsible to decide if a timeout should be swallowed? Or do you have anything else in mind?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.
I think TimeoutException is the one, yes, but more importantly we should see if our timeout values are set reasonably in Streams :)