-
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
[Transform] add throttling #56007
[Transform] add throttling #56007
Conversation
Pinging @elastic/ml-core (:ml/Transform) |
e8964c9
to
d9af494
Compare
|
||
import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; | ||
|
||
public class SettingsConfig implements Writeable, ToXContentObject { |
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 am not a big fan of a settings
clause in the configuration.
The whole configuration is settings. It's settings for a transform.
Additionally, if we are ever going to say there are more transforms than pivot
, this means those other transforms will have to abide by whatever settings are in this object.
It seems to me that these options should be in the pivot
configuration.
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.
Perhaps ThrottlingConfig
As max_page_search_size
is already in PivotConfig it is tempting to add docs_per_second
as a loose field in PivotConfig and avoid deprecating PivotConfig.max_page_search_size
and the associated BWC code. Possibly I am just a lazy programmer
...m/src/main/java/org/elasticsearch/xpack/transform/action/TransportUpdateTransformAction.java
Outdated
Show resolved
Hide resolved
* @return the {@link Builder} with requestsPerSecond set. | ||
*/ | ||
public Builder setRequestsPerSecond(Float docsPerSecond) { | ||
this.docsPerSecond = docsPerSecond; |
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 seems to me that a null
passed in here is where you want to set the default values back. Otherwise, it becomes complicated to know when a null
means "not supplied" vs "revert to default"
Similar comment for setMaxPageSearchSize
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 just found this to be a problem in hlrc (and fixed it there, not pushed yet).
However I wonder if this is really a problem in this place, both setters are not used, but only update. Maybe I rename this class to Updater and remove the setters.
...n/transform/src/main/java/org/elasticsearch/xpack/transform/transforms/TransformIndexer.java
Outdated
Show resolved
Hide resolved
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.
All looks good to me. I think this is practically complete isn't it?
.../core/src/main/java/org/elasticsearch/xpack/core/transform/action/UpdateTransformAction.java
Show resolved
Hide resolved
|
||
import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; | ||
|
||
public class SettingsConfig implements Writeable, ToXContentObject { |
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.
Perhaps ThrottlingConfig
As max_page_search_size
is already in PivotConfig it is tempting to add docs_per_second
as a loose field in PivotConfig and avoid deprecating PivotConfig.max_page_search_size
and the associated BWC code. Possibly I am just a lazy programmer
...e/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformConfigUpdate.java
Outdated
Show resolved
Hide resolved
...t-high-level/src/main/java/org/elasticsearch/client/transform/transforms/SettingsConfig.java
Show resolved
Hide resolved
.../core/src/main/java/org/elasticsearch/xpack/core/transform/action/UpdateTransformAction.java
Show resolved
Hide resolved
run elasticsearch-ci/bwc |
ec83eeb
to
65586e3
Compare
Resetting to defaults now works as this:
There are some corner cases and things to improve, I like to address them as separate 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.
LGTM
The logic of resetting default values with an explicit null is quite complicated could you add a yml test to cover that please.
This is tested in all possible permutations here: (hlrc, not yml, given that hlrc tests ensure I send |
add throttling to transform, throttling will slow down search requests by delaying the execution based on a documents per second metric. fixes elastic#54862
add documentation for throttling, added in #56007
add documentation for throttling, added in #56007
add documentation for throttling, added in #56007
…7871) fixes the page size reported after moving page size to settings(elastic#56007) and adds documents per second(throttling) to the output. fixes elastic#56498
add throttling to transform, throttling will slow down search requests by delaying the execution based on a documents per second metric. All details can be found in #54862
todo:
stats returning docs/s(-> separate PR)