4242import java .util .function .LongUnaryOperator ;
4343import java .util .function .ToLongFunction ;
4444
45+ import static org .elasticsearch .cluster .routing .allocation .DiskThresholdSettings .CLUSTER_ROUTING_ALLOCATION_DISK_FLOOD_STAGE_MAX_HEADROOM_SETTING ;
46+ import static org .elasticsearch .cluster .routing .allocation .DiskThresholdSettings .CLUSTER_ROUTING_ALLOCATION_DISK_FLOOD_STAGE_WATERMARK_SETTING ;
4547import static org .elasticsearch .index .engine .ThreadPoolMergeScheduler .Schedule .ABORT ;
4648import static org .elasticsearch .index .engine .ThreadPoolMergeScheduler .Schedule .BACKLOG ;
4749import static org .elasticsearch .index .engine .ThreadPoolMergeScheduler .Schedule .RUN ;
@@ -58,7 +60,7 @@ public class ThreadPoolMergeExecutorService implements Closeable {
5860 );
5961 public static final Setting <RelativeByteSizeValue > INDICES_MERGE_DISK_HIGH_WATERMARK_SETTING = new Setting <>(
6062 "indices.merge.disk.watermark.high" ,
61- "96%" ,
63+ CLUSTER_ROUTING_ALLOCATION_DISK_FLOOD_STAGE_WATERMARK_SETTING ,
6264 (s ) -> RelativeByteSizeValue .parseRelativeByteSizeValue (s , "indices.merge.disk.watermark.high" ),
6365 new Setting .Validator <>() {
6466 @ Override
@@ -81,6 +83,7 @@ public Iterator<Setting<?>> settings() {
8183 return res .iterator ();
8284 }
8385 },
86+ Setting .Property .Dynamic ,
8487 Setting .Property .NodeScope
8588 );
8689 public static final Setting <ByteSizeValue > INDICES_MERGE_DISK_HIGH_MAX_HEADROOM_SETTING = new Setting <>(
@@ -89,7 +92,7 @@ public Iterator<Setting<?>> settings() {
8992 if (INDICES_MERGE_DISK_HIGH_WATERMARK_SETTING .exists (settings )) {
9093 return "-1" ;
9194 } else {
92- return "40GB" ;
95+ return CLUSTER_ROUTING_ALLOCATION_DISK_FLOOD_STAGE_MAX_HEADROOM_SETTING . get ( settings ). toString () ;
9396 }
9497 },
9598 (s ) -> ByteSizeValue .parseBytesSizeValue (s , "indices.merge.disk.watermark.high.max_headroom" ),
@@ -130,6 +133,7 @@ public Iterator<Setting<?>> settings() {
130133 return res .iterator ();
131134 }
132135 },
136+ Setting .Property .Dynamic ,
133137 Setting .Property .NodeScope
134138 );
135139 /**
0 commit comments