-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Properly support task batches in ReservedStateUpdateTaskExecutor #116353
Closed
Closed
Changes from 7 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
151a67c
Unit test ReservedStateUpdateTaskExecutor only running the last task
prdoyle b508682
Fix ReservedStateUpdateTaskExecutor to run only the last task
prdoyle 8a3c21b
Spotless
prdoyle fdbcbc1
Use penultimate update if the last one failed
prdoyle d8261b8
Merge branch 'main' into es-9360-2
prdoyle 71b3f29
Fix test method name to match what it does
prdoyle f249c76
IT for testLastSettingsInBatchApplied
prdoyle 8f2f728
Merge remote-tracking branch 'upstream/main' into es-9360-2
prdoyle dc19d66
Consider version numbers in upsdate batches
prdoyle a85a1e1
Track and assert on task completion
prdoyle 893a81c
Assert each task's state
prdoyle bf82519
Use sorting.
prdoyle 5b41abf
Merge remote-tracking branch 'upstream/main' into es-9360-2
prdoyle 70269ba
Spotless
prdoyle b8e4944
Merge branch 'main' into es-9360-2
prdoyle c152d05
Fixes and comments
prdoyle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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.
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.
Could we sometimes try 3, I have a hunch that might cover some logic that the 2 case doesn't.
Could we give them different
version
values? And not always apply them in ascending order?Could we wait for the master to pick up one file before writing the next?
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.
Good ideas!
Waiting for the master to pick up one file before writing the next would exercise existing functionality, rather than my changes, but it's obviously an important case to test.
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.
What is the expected behaviour when the versions are not ascending?
Should
ReservedStateUpdateTaskExecutor
be attempting them in descending version order rather than just iterating backward through the batch list?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.
The guiding principle is that the expected outcome should be the same whether the tasks are executed in a single batch or one-at-a-time. So yes AIUI I think we should attempt them in descending version order.
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.
Ah of course, that makes perfect sense. I'll make that change (on the assumption that updates with lower version numbers are ignored if processed one-per-batch).
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.
Hmm, I found this javadoc for
TaskContext
:It seems we can't simply skip the intervening tasks after all?
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.
You have to call
success
(oronFailure
) to record the outcome of the task, but that doesn't mean you have to actually do anything else with the task. According to the guiding principle, skipping a task because we processed a newer one counts as success right?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.
Alright makes sense. So perhaps:
ReservedStateVersionCheck
mode.success
on that one and all prior ones, and possibly on all following ones?onFailure
, remove it from the candidates list, and loop back to step 1.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.
Yeah that sounds right although maybe it'd be simpler just to sort the list of tasks in the right order ?
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 was afraid I couldn't determine the right order before I know whether the first fails. But now that I think about it, if the first task succeeds, the rest are irrelevant, so I could sort them on the assumption that each one fails.