-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Enable write load constraint decider by default #135246
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
Changes from 10 commits
7365324
7a8536d
2402099
14c936d
b4f08dd
d33f49a
5068f10
6a93c56
df43301
c423850
149b2ea
9845c38
917c617
720ff18
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,7 @@ | |
| import org.elasticsearch.common.settings.ClusterSettings; | ||
| import org.elasticsearch.common.settings.Setting; | ||
| import org.elasticsearch.common.unit.RatioValue; | ||
| import org.elasticsearch.common.util.FeatureFlag; | ||
| import org.elasticsearch.core.TimeValue; | ||
|
|
||
| /** | ||
|
|
@@ -23,6 +24,7 @@ | |
| public class WriteLoadConstraintSettings { | ||
|
|
||
| private static final String SETTING_PREFIX = "cluster.routing.allocation.write_load_decider."; | ||
| private static final FeatureFlag WRITE_LOAD_DECIDER_ENABLED_FF = new FeatureFlag("write_load_decider_enabled"); | ||
|
||
|
|
||
| public enum WriteLoadDeciderStatus { | ||
| /** | ||
|
|
@@ -59,7 +61,7 @@ public boolean disabled() { | |
| public static final Setting<WriteLoadDeciderStatus> WRITE_LOAD_DECIDER_ENABLED_SETTING = Setting.enumSetting( | ||
| WriteLoadDeciderStatus.class, | ||
| SETTING_PREFIX + "enabled", | ||
| WriteLoadDeciderStatus.DISABLED, | ||
| WriteLoadDeciderStatus.ENABLED, | ||
| Setting.Property.Dynamic, | ||
| Setting.Property.NodeScope | ||
| ); | ||
|
|
@@ -113,7 +115,11 @@ public boolean disabled() { | |
| private volatile TimeValue queueLatencyThreshold; | ||
|
|
||
| public WriteLoadConstraintSettings(ClusterSettings clusterSettings) { | ||
| clusterSettings.initializeAndWatch(WRITE_LOAD_DECIDER_ENABLED_SETTING, status -> this.writeLoadDeciderStatus = status); | ||
| if (WRITE_LOAD_DECIDER_ENABLED_FF.isEnabled()) { | ||
| clusterSettings.initializeAndWatch(WRITE_LOAD_DECIDER_ENABLED_SETTING, status -> this.writeLoadDeciderStatus = status); | ||
| } else { | ||
| writeLoadDeciderStatus = WriteLoadDeciderStatus.DISABLED; | ||
| } | ||
|
||
| clusterSettings.initializeAndWatch( | ||
| WRITE_LOAD_DECIDER_REROUTE_INTERVAL_SETTING, | ||
| timeValue -> this.minimumRerouteInterval = timeValue | ||
|
|
||
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.
Would your helper method be appropriate for an explicit DISABLED settings update in the
finallyblock below, and in other tests?IIUC, we'll still need the finally block's disable setting update, so that these tests will pass when the release build runs?
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.
ESSingleNodeTestCasechecks that there is no persistent metadata (including settings) left behind in teardown, so we need to clear these settings before the test ends.We need to clear the settings, rather than setting them to a specific value. I've added a helper for that too in 9845c38
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 changes here are just to stop depending on the default being one way or another, because this will change depending on the feature flag.