-
Notifications
You must be signed in to change notification settings - Fork 25.3k
#111433 Watch Next Run Interval Resets On Shard Move or Node Restart #115102
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
Merged
lukewhiting
merged 6 commits into
elastic:main
from
lukewhiting:111433-watcher-interval-on-shard-move
Oct 22, 2024
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
bee4aa1
Switch Watcher scheduler to use last exec time
lukewhiting e3ffbeb
Add tests for last runtime calculation
lukewhiting c7ecfd8
Update docs/changelog/115102.yaml
lukewhiting 6f37ce1
Add counter to watcher job executions to check no additional executio…
lukewhiting 34a2203
Merge branch 'main' of github.com:elastic/elasticsearch into 111433-w…
lukewhiting 6906a74
Merge branch 'main' of github.com:elastic/elasticsearch into 111433-w…
lukewhiting 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 hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
pr: 115102 | ||
summary: Watch Next Run Interval Resets On Shard Move or Node Restart | ||
area: Watcher | ||
type: bug | ||
issues: | ||
- 111433 |
This file contains hidden or 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 hidden or 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.
It would be good to have short comments on each of these 4 tests describing what they're for. It took me a few minutes to figure out how they all differed. And in the case of this test, are you trying to show that it does not execute too many times if you advance the clock a good bit? Is it worth adding another latch or two to prove that the watch hasn't run when you expect it not to have run yet?
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.
So there's essentially 2 conditions tested across 4 tests here. Watches with a
lastCheckedTime
and those who don't have alastCheckedTime
but do have alastActivationTime
. For each of those, we test both the startup of the watcher service and adding those watches to an already running service.For the startup tests, we you the latches to ensure it runs once before the interval (to verify it picked up the last run time) and for each add to running service test we start up watcher, tick the clock forward to show some time passing then add the watches and check they execute once before the interval time and once again after the interval time.
I have added some comments to better explain each test and good idea on adding a check to make sure they don't run more times than expected. I have added that as well.