Skip to content

Deprecate setting max_merge_at_once_explicit #80574

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

Merged
merged 1 commit into from
Nov 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -712,10 +712,7 @@ public IndexSettings(final IndexMetadata indexMetadata, final Settings nodeSetti
MergePolicyConfig.INDEX_MERGE_POLICY_MAX_MERGE_AT_ONCE_SETTING,
mergePolicyConfig::setMaxMergesAtOnce
);
scopedSettings.addSettingsUpdateConsumer(
MergePolicyConfig.INDEX_MERGE_POLICY_MAX_MERGE_AT_ONCE_EXPLICIT_SETTING,
mergePolicyConfig::setMaxMergesAtOnceExplicit
);
scopedSettings.addSettingsUpdateConsumer(MergePolicyConfig.INDEX_MERGE_POLICY_MAX_MERGE_AT_ONCE_EXPLICIT_SETTING, ignored -> {});
scopedSettings.addSettingsUpdateConsumer(
MergePolicyConfig.INDEX_MERGE_POLICY_MAX_MERGED_SEGMENT_SETTING,
mergePolicyConfig::setMaxMergedSegment
Expand Down
41 changes: 13 additions & 28 deletions server/src/main/java/org/elasticsearch/index/MergePolicyConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@
* Maximum number of segments to be merged at a time during "normal" merging.
* Default is <code>10</code>.
*
* <li><code>index.merge.policy.max_merge_at_once_explicit</code>:
*
* Maximum number of segments to be merged at a time, during force merge or
* expungeDeletes. Default is <code>30</code>.
*
* <li><code>index.merge.policy.max_merged_segment</code>:
*
* Maximum sized segment to produce during normal merging (not explicit
Expand Down Expand Up @@ -113,7 +108,6 @@ public final class MergePolicyConfig {
public static final double DEFAULT_EXPUNGE_DELETES_ALLOWED = 10d;
public static final ByteSizeValue DEFAULT_FLOOR_SEGMENT = new ByteSizeValue(2, ByteSizeUnit.MB);
public static final int DEFAULT_MAX_MERGE_AT_ONCE = 10;
public static final int DEFAULT_MAX_MERGE_AT_ONCE_EXPLICIT = 30;
public static final ByteSizeValue DEFAULT_MAX_MERGED_SEGMENT = new ByteSizeValue(5, ByteSizeUnit.GB);
public static final double DEFAULT_SEGMENTS_PER_TIER = 10.0d;
public static final double DEFAULT_DELETES_PCT_ALLOWED = 33.0d;
Expand Down Expand Up @@ -145,11 +139,11 @@ public final class MergePolicyConfig {
Property.Dynamic,
Property.IndexScope
);
// TODO deprecate this as it no longer has any effect
public static final Setting<Integer> INDEX_MERGE_POLICY_MAX_MERGE_AT_ONCE_EXPLICIT_SETTING = Setting.intSetting(
"index.merge.policy.max_merge_at_once_explicit",
DEFAULT_MAX_MERGE_AT_ONCE_EXPLICIT,
30,
2,
Property.Deprecated,
Property.Dynamic,
Property.IndexScope
);
Expand Down Expand Up @@ -182,8 +176,6 @@ public final class MergePolicyConfig {
double forceMergeDeletesPctAllowed = indexSettings.getValue(INDEX_MERGE_POLICY_EXPUNGE_DELETES_ALLOWED_SETTING); // percentage
ByteSizeValue floorSegment = indexSettings.getValue(INDEX_MERGE_POLICY_FLOOR_SEGMENT_SETTING);
int maxMergeAtOnce = indexSettings.getValue(INDEX_MERGE_POLICY_MAX_MERGE_AT_ONCE_SETTING);
// TODO this is removed from lucene 9 - do we need to emit a warning if it is set?
int maxMergeAtOnceExplicit = indexSettings.getValue(INDEX_MERGE_POLICY_MAX_MERGE_AT_ONCE_EXPLICIT_SETTING);
// TODO is this really a good default number for max_merge_segment, what happens for large indices,
// won't they end up with many segments?
ByteSizeValue maxMergedSegment = indexSettings.getValue(INDEX_MERGE_POLICY_MAX_MERGED_SEGMENT_SETTING);
Expand All @@ -204,20 +196,17 @@ public final class MergePolicyConfig {
mergePolicy.setMaxMergedSegmentMB(maxMergedSegment.getMbFrac());
mergePolicy.setSegmentsPerTier(segmentsPerTier);
mergePolicy.setDeletesPctAllowed(deletesPctAllowed);
if (logger.isTraceEnabled()) {
logger.trace(
"using [tiered] merge mergePolicy with expunge_deletes_allowed[{}], floor_segment[{}],"
+ " max_merge_at_once[{}], max_merge_at_once_explicit[{}], max_merged_segment[{}], segments_per_tier[{}],"
+ " deletes_pct_allowed[{}]",
forceMergeDeletesPctAllowed,
floorSegment,
maxMergeAtOnce,
maxMergeAtOnceExplicit,
maxMergedSegment,
segmentsPerTier,
deletesPctAllowed
);
}
logger.trace(
"using [tiered] merge mergePolicy with expunge_deletes_allowed[{}], floor_segment[{}],"
+ " max_merge_at_once[{}], max_merged_segment[{}], segments_per_tier[{}],"
+ " deletes_pct_allowed[{}]",
forceMergeDeletesPctAllowed,
floorSegment,
maxMergeAtOnce,
maxMergedSegment,
segmentsPerTier,
deletesPctAllowed
);
}

void setSegmentsPerTier(Double segmentsPerTier) {
Expand All @@ -228,10 +217,6 @@ void setMaxMergedSegment(ByteSizeValue maxMergedSegment) {
mergePolicy.setMaxMergedSegmentMB(maxMergedSegment.getMbFrac());
}

void setMaxMergesAtOnceExplicit(Integer maxMergeAtOnceExplicit) {

}

void setMaxMergesAtOnce(Integer maxMergeAtOnce) {
mergePolicy.setMaxMergeAtOnce(maxMergeAtOnce);
}
Expand Down