-
Notifications
You must be signed in to change notification settings - Fork 313
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 wait for recovery to finish #800
Properly wait for recovery to finish #800
Conversation
With this commit we ensure that a proper schedule is chosen when waiting for shard recovery to finish. We also ensure that a short time-span where no recoveries are active (but more might continue soon) is not mistakenly treated as a condition where all recoveries have already finished. Closes elastic#796
With the operation ``wait-for-recovery`` you can wait until an ongoing index recovery finishes. The ``wait-for-recovery`` operation does not support any parameters. | ||
With the operation ``wait-for-recovery`` you can wait until an ongoing shard recovery finishes. The ``wait-for-recovery`` operation supports the following parameters: | ||
|
||
* ``completion-recheck-attempts`` (optional, defaults to 3): It might be possible that the `index recovery API <https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-recovery.html>`_ reports that there are no active shard recoveries when a new one might be scheduled shortly afterwards. Therefore, this operation will check several times whether there are still no active recoveries. In between those attempts, it will wait for a time period specified by ``completion-recheck-wait-period``. |
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.
s/It might/It's
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 fixing the operation!
I think that there are some tests that will fail if this gets merged onto the current master due to the fixes in #801
e.g. https://github.com/elastic/rally/pull/800/files#diff-ec2b07b543fca9aae6cbecf501cfe53aL227
fails with
E TypeError: 'ScheduleHandle' object is not iterable
tests/driver/driver_test.py
Outdated
(2.0, metrics.SampleType.Normal, None, {"body": ["a"]}), | ||
(3.0, metrics.SampleType.Normal, None, {"body": ["a"]}), | ||
(4.0, metrics.SampleType.Normal, None, {"body": ["a"]}), | ||
], invocations, infinite_schedule=True) |
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 that when we merge this to current master it's going to fail due to https://github.com/elastic/rally/pull/801/files
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 catch! I've merged master and changed the test now in 78235be.
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.
LGTM thanks!
To run an operation every 10s we specify target-interval rather than target-throughput. Relates elastic#800
With this commit we ensure that a proper schedule is chosen when waiting
for shard recovery to finish. We also ensure that a short time-span where no
recoveries are active (but more might continue soon) is not mistakenly
treated as a condition where all recoveries have already finished.
Closes #796