diff --git a/server/src/main/java/org/opensearch/indices/recovery/RecoverySettings.java b/server/src/main/java/org/opensearch/indices/recovery/RecoverySettings.java index 4f5c408d86a45..21279dc583d18 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/RecoverySettings.java +++ b/server/src/main/java/org/opensearch/indices/recovery/RecoverySettings.java @@ -177,9 +177,11 @@ public class RecoverySettings { ); // choose 512KB-16B to ensure that the resulting byte[] is not a humongous allocation in G1. + public static final ByteSizeValue DEFAULT_CHUNK_SIZE = new ByteSizeValue(512 * 1024 - 16, ByteSizeUnit.BYTES); + public static final Setting INDICES_RECOVERY_CHUNK_SIZE_SETTING = Setting.byteSizeSetting( "indices.recovery.chunk_size", - new ByteSizeValue(512 * 1024 - 16, ByteSizeUnit.BYTES), + DEFAULT_CHUNK_SIZE, new ByteSizeValue(1, ByteSizeUnit.BYTES), new ByteSizeValue(100, ByteSizeUnit.MB), Property.Dynamic,