-
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
Force Merge Runner Improvements - Polling #1051
Conversation
elastic#1049) * Hints for handling errors and identifying queries and responses * Fix formatting errors * Fix links and formatting * Grammatical fixes
@dliappis This is ready for an initial review now all CI tests pass. |
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.
Thank you for this super useful addition!
I left a number of style comments (unfortunately we skip many errors that pylint would normally report, see #838)
I haven't tested this yet, will do this asap.
esrally/driver/runner.py
Outdated
@@ -618,11 +617,28 @@ async def __call__(self, es, params): | |||
# the raw transport API (where the keyword argument is called `timeout`) in some cases we will always need | |||
# a special handling for the force-merge API. | |||
request_timeout = params.get("request-timeout") | |||
mode = params.get("mode") | |||
merge_params = { "request_timeout": request_timeout} |
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.
nit: https://www.flake8rules.com/rules/E201.html: merge_params = {"request_timeout": request_timeout}
(IDE should want you about this, unfortunately #838 isn't done yet to help us in CI).
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.
Also line 608 needs an additional whitespace, see https://www.flake8rules.com/rules/E302.html
esrally/resources/track-schema.json
Outdated
"mode": { | ||
"type": "string", | ||
"enum": ["blocking", "polling"], | ||
"description": "[Only for type 'force-merge']: Determines whether forced merged is blocking, causing a potential client timeout, or if it polls until no further force merge tasks." |
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/force merged/force merge
esrally/track/params.py
Outdated
@@ -609,7 +609,6 @@ def _init_internal_params(self): | |||
def percent_completed(self): | |||
return self.current_bulk / self.total_bulks | |||
|
|||
|
|||
class ForceMergeParamSource(ParamSource): |
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.
tests/driver/runner_test.py
Outdated
} | ||
}), | ||
as_future({ | ||
"nodes":{} |
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.
tests/driver/runner_test.py
Outdated
}) | ||
] | ||
force_merge = runner.ForceMerge() | ||
await force_merge(es, params={"index" : "_all", "mode": "polling", 'poll-period': 0}) |
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.
https://www.flake8rules.com/rules/E203.html ; also let's stick to double quotes (it's a convention in the Rally codebase).
tests/driver/runner_test.py
Outdated
} | ||
}), | ||
as_future({ | ||
"nodes":{} |
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.
tests/driver/runner_test.py
Outdated
force_merge = runner.ForceMerge() | ||
# request-timeout should be ignored as mode:polling | ||
await force_merge(es, params={"index" : "_all", "mode": "polling", "max-num-segments": 1, | ||
"request-timeout": 50000, 'poll-period': 0}) |
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.
Similar comment here: https://www.flake8rules.com/rules/E203.html and double quotes instead of single quotes.
tests/track/params_test.py
Outdated
@@ -1811,7 +1811,6 @@ def test_replaces_body_params(self): | |||
|
|||
self.assertNotEqual(first, second) | |||
|
|||
|
|||
class ForceMergeParamSourceTests(TestCase): |
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.
@dliappis i believe i have addressed the formatting issues. If you're happy with the approach i'll add docs. |
…lastic#1055) When race didn't have total_transform_processing_times to report, `esrally compare` fails Relates to elastic#1022
"operation" : "scroll", | ||
"operation-type" : "Search" | ||
} | ||
|
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.
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.
@gingerwizard I still see this unrelated recipe in docs (coming from the older PR).
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.
@gingerwizard I tested this yesterday in a real long benchmark where force merging down to 1 segment takes a very long time the polling mode worked marvelously. Let's proceed with docs.
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.
Have you added docs already for the polling mode of the force merge runner? I didn't see anything in this review cycle.
"operation" : "scroll", | ||
"operation-type" : "Search" | ||
} | ||
|
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.
@gingerwizard I still see this unrelated recipe in docs (coming from the older PR).
@elasticmachine test this |
@elasticmachine run tests |
This adds a polling mode to the force-merge runner and in the process closes #1050
Some considerations:
mode
parameter. This defaults toblocking
which causes the current behaviour.polling
we ignore therequest-timeout
parameter and timeout the force_merge API call after 1s. We then poll the tasks API at an interval ofpoll-period
(default 10s), until no force-merge tasks are listed.max-num-segments
has been reached.Will add docs once parameter naming and usage is agreed.