Skip to content

Conversation

kh3ra
Copy link
Contributor

@kh3ra kh3ra commented Oct 14, 2025

Description

[Describe what this change achieves]

  1. Standardized merged_segment_warmer related config names.
  2. Added a threshold property that controls which merged segments get pre-copied (warmed), ensuring only segments larger than the specified size are processed.
  3. Added a multiplier to allow fine grained control over indexing throttling caused by ongoing merges.

Related Issues

Resolves #[Issue number to be closed when this PR is merged]

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link
Contributor

❌ Gradle check result for 3aeef75: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Comment on lines 101 to 105
if (segmentSize < indexShard.getRecoverySettings().getMergedSegmentWarmerSegmentSizeThreshold().getBytes()) {
return false;
}

return true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be simplified to :

        return segmentSize >= indexShard.getRecoverySettings().getMergedSegmentWarmerSegmentSizeThreshold().getBytes();

if (segmentSize < indexShard.getRecoverySettings().getMergedSegmentWarmerSegmentSizeThreshold().getBytes()) {
return false;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets add some trace/debug logs on the final return with diagnostic data

Copy link
Contributor

❌ Gradle check result for f0feabe: null

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@kh3ra kh3ra force-pushed the dev/merged-segment-warmer-configs branch from f0feabe to 34610d9 Compare October 15, 2025 08:49
Copy link
Contributor

❌ Gradle check result for bbd9dd4: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Added a threshold property that controls which merged segments get pre-copied (warmed), ensuring only segments larger than the specified size are processed.
Added cluster defaults for max_merge_count and max_merge_threads

Signed-off-by: Aditya Khera <[email protected]>
@kh3ra kh3ra force-pushed the dev/merged-segment-warmer-configs branch from bbd9dd4 to 2459597 Compare October 15, 2025 10:08
Copy link
Contributor

❌ Gradle check result for 2459597: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❌ Gradle check result for 36d0a37: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Signed-off-by: Aditya Khera <[email protected]>
Copy link
Contributor

❌ Gradle check result for 4aec3d9: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Signed-off-by: Aditya Khera <[email protected]>
Copy link
Contributor

❌ Gradle check result for b06e2ac: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Signed-off-by: Aditya Khera <[email protected]>
Copy link
Contributor

❌ Gradle check result for cd48be6: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❌ Gradle check result for 2ce4ef8: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Signed-off-by: Aditya Khera <[email protected]>
Copy link
Contributor

❌ Gradle check result for 87cad2d: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❌ Gradle check result for f8cf13c: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Signed-off-by: Aditya Khera <[email protected]>
@kh3ra kh3ra force-pushed the dev/merged-segment-warmer-configs branch from f8cf13c to 2f943c3 Compare October 17, 2025 13:55
Copy link
Contributor

❌ Gradle check result for 2f943c3: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Comment on lines +300 to +306
public static final Setting<Integer> CLUSTER_DEFAULT_MAX_THREAD_COUNT_SETTING = new Setting<>(
"cluster.default.index.merge.scheduler.max_thread_count",
(s) -> Integer.toString(Math.max(1, Math.min(4, OpenSearchExecutors.allocatedProcessors(s) / 2))),
(s) -> Setting.parseInt(s, 1, "cluster.default.index.merge.scheduler.max_thread_count"),
Property.Dynamic,
Property.NodeScope
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Maybe good to remove default in the settings name given it can be overridden, dynamically?

Comment on lines +79 to +87
/**
* Dynamic setting to set a threshold for minimum size of a merged segment to be warmed.
*/
public static final Setting<ByteSizeValue> INDICES_REPLICATION_MERGES_WARMER_SEGMENT_SIZE_THRESHOLD_SETTING = Setting.byteSizeSetting(
"indices.replication.merges.warmer.segment_size_threshold",
new ByteSizeValue(500, ByteSizeUnit.MB),
Property.Dynamic,
Property.NodeScope
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: The name doesn't reflect a minimum threshold size?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants