-
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
Disk watermark validation rejects apparently valid sequence of updates #28309
Comments
This also happens with high versus low and is still present in v6.2.3
|
I can confirm this is still in 6.3.2 thanks to @Xylakant for pointing me here |
Looks interesting, I'd like to work on it if no one has already started to do so. |
Here is a complete cURL recreation script, see Gist here. |
Issue found and reproduced on It happens that when setting only the To me, the real issue here is that we have dependencies between three parameters ( elasticsearch/server/src/main/java/org/elasticsearch/common/settings/AbstractScopedSettings.java Lines 702 to 719 in c74c46e
|
I've reworked my comment on this issue to make it easier to read. Could you please have a look at it and tell us what do you think? Thanks a lot. |
Hi @cbismuth, you can reproduce this in a unit test as follows: diff --git a/server/src/test/java/org/elasticsearch/cluster/routing/allocation/DiskThresholdSettingsTests.java b/server/src/test/java/org/elasticsearch/cluster/routing/allocation/DiskThresholdSettingsTests.java
index 342fcea7dde..b99c13e2d99 100644
--- a/server/src/test/java/org/elasticsearch/cluster/routing/allocation/DiskThresholdSettingsTests.java
+++ b/server/src/test/java/org/elasticsearch/cluster/routing/allocation/DiskThresholdSettingsTests.java
@@ -203,4 +203,10 @@ public class DiskThresholdSettingsTests extends ESTestCase {
assertThat(cause, hasToString(containsString("low disk watermark [85%] more than high disk watermark [75%]")));
}
+ public void testSequenceOfUpdates() {
+ final ClusterSettings clusterSettings = new ClusterSettings(Settings.EMPTY, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS);
+ new DiskThresholdSettings(Settings.EMPTY, clusterSettings); // this has the effect of registering the settings updater
+ clusterSettings.applySettings(Settings.builder().put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_DISK_FLOOD_STAGE_WATERMARK_SETTING.getKey(), "99%").build());
+ clusterSettings.applySettings(Settings.builder().put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_HIGH_DISK_WATERMARK_SETTING.getKey(), "97%").build());
+ }
} I'm not sure what you mean by "these dependencies aren't expressed in the code" - e.g. the Lines 105 to 110 in 31aabe4
|
Sorry, I'll reword. You're right @DaveCTurner, static dependencies are expressed in the code. But when triggering validation, runtime cluster state values (containing In my previous comment, the runtime cluster state values are enclosed in the Is it clearer? |
Right, that makes sense. I tried changing |
Yes, this API has a lot of usages. Thank you for the unit test, I’ll play with it 👍 |
I had a look to available validation APIs in No test seems to be broken on my laptop. There may be a small overhead, but I let you give me your opinion on this. Reported issue is fixed with these changes, and here is a sample output when
|
@DaveCTurner I've added the unit test you suggested. Does it make sense to you or did I miss something? |
Closed by #34184. |
On a fresh one-node cluster, the first of these operations succeeds but the second fails:
The result is:
This is surprising because the flood stage watermark was set to
99%
but the error message claims it is still95%
. As expected,GET _cluster/settings
yields:Setting both watermarks together succeeds:
I see the same effect replacing
transient
withpersistent
throughout too.The text was updated successfully, but these errors were encountered: