Skip to content
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

[Remove] index.merge.policy.max_merge_at_once_explicit #1988

Merged
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 @@ -118,7 +118,6 @@ public final class IndexScopedSettings extends AbstractScopedSettings {
MergePolicyConfig.INDEX_MERGE_POLICY_EXPUNGE_DELETES_ALLOWED_SETTING,
MergePolicyConfig.INDEX_MERGE_POLICY_FLOOR_SEGMENT_SETTING,
MergePolicyConfig.INDEX_MERGE_POLICY_MAX_MERGE_AT_ONCE_SETTING,
MergePolicyConfig.INDEX_MERGE_POLICY_MAX_MERGE_AT_ONCE_EXPLICIT_SETTING,
MergePolicyConfig.INDEX_MERGE_POLICY_MAX_MERGED_SEGMENT_SETTING,
MergePolicyConfig.INDEX_MERGE_POLICY_SEGMENTS_PER_TIER_SETTING,
MergePolicyConfig.INDEX_MERGE_POLICY_RECLAIM_DELETES_WEIGHT_SETTING,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -714,8 +714,6 @@ public IndexSettings(final IndexMetadata indexMetadata, final Settings nodeSetti
MergePolicyConfig.INDEX_MERGE_POLICY_MAX_MERGE_AT_ONCE_SETTING,
mergePolicyConfig::setMaxMergesAtOnce
);
// todo: remove this in 2.0.0 since it was removed in lucene 9
scopedSettings.addSettingsUpdateConsumer(MergePolicyConfig.INDEX_MERGE_POLICY_MAX_MERGE_AT_ONCE_EXPLICIT_SETTING, noop -> {});
scopedSettings.addSettingsUpdateConsumer(
MergePolicyConfig.INDEX_MERGE_POLICY_MAX_MERGED_SEGMENT_SETTING,
mergePolicyConfig::setMaxMergedSegment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,6 @@ public final class MergePolicyConfig {
Property.Dynamic,
Property.IndexScope
);
@Deprecated
public static final Setting<Integer> INDEX_MERGE_POLICY_MAX_MERGE_AT_ONCE_EXPLICIT_SETTING = Setting.intSetting(
"index.merge.policy.max_merge_at_once_explicit",
30,
2,
Property.Deprecated,
Property.Dynamic,
Property.IndexScope
);
public static final Setting<ByteSizeValue> INDEX_MERGE_POLICY_MAX_MERGED_SEGMENT_SETTING = Setting.byteSizeSetting(
"index.merge.policy.max_merged_segment",
DEFAULT_MAX_MERGED_SEGMENT,
Expand Down Expand Up @@ -209,7 +200,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);
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 @@ -228,19 +218,17 @@ public final class MergePolicyConfig {
mergePolicy.setForceMergeDeletesPctAllowed(forceMergeDeletesPctAllowed);
mergePolicy.setFloorSegmentMB(floorSegment.getMbFrac());
mergePolicy.setMaxMergeAtOnce(maxMergeAtOnce);
mergePolicy.setMaxMergeAtOnceExplicit(maxMergeAtOnceExplicit);
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[{}],"
+ " max_merge_at_once[{}], max_merged_segment[{}], segments_per_tier[{}],"
+ " deletes_pct_allowed[{}]",
forceMergeDeletesPctAllowed,
floorSegment,
maxMergeAtOnce,
maxMergeAtOnceExplicit,
maxMergedSegment,
segmentsPerTier,
deletesPctAllowed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,6 @@ public int getMaxMergeAtOnce() {
return regularMergePolicy.getMaxMergeAtOnce();
}

@Deprecated
public void setMaxMergeAtOnceExplicit(int maxMergeAtOnceExplicit) {
regularMergePolicy.setMaxMergeAtOnceExplicit(maxMergeAtOnceExplicit);
forcedMergePolicy.setMaxMergeAtOnceExplicit(maxMergeAtOnceExplicit);
}

@Deprecated
public int getMaxMergeAtOnceExplicit() {
return forcedMergePolicy.getMaxMergeAtOnceExplicit();
}

// only setter that must NOT delegate to the forced merge policy
public void setMaxMergedSegmentMB(double mbFrac) {
regularMergePolicy.setMaxMergedSegmentMB(mbFrac);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,19 +156,6 @@ public void testTieredMergePolicySettingsUpdate() throws IOException {
MergePolicyConfig.DEFAULT_MAX_MERGE_AT_ONCE - 1
);

assertEquals(((OpenSearchTieredMergePolicy) indexSettings.getMergePolicy()).getMaxMergeAtOnceExplicit(), 30);
indexSettings.updateIndexMetadata(
newIndexMeta(
"index",
Settings.builder().put(MergePolicyConfig.INDEX_MERGE_POLICY_MAX_MERGE_AT_ONCE_EXPLICIT_SETTING.getKey(), 29).build()
)
);
assertWarnings(
"[index.merge.policy.max_merge_at_once_explicit] setting was "
+ "deprecated in OpenSearch and will be removed in a future release! See the breaking changes "
+ "documentation for the next major version."
);

assertEquals(
((OpenSearchTieredMergePolicy) indexSettings.getMergePolicy()).getMaxMergedSegmentMB(),
MergePolicyConfig.DEFAULT_MAX_MERGED_SEGMENT.getMbFrac(),
Expand Down Expand Up @@ -252,7 +239,6 @@ public void testTieredMergePolicySettingsUpdate() throws IOException {
((OpenSearchTieredMergePolicy) indexSettings.getMergePolicy()).getMaxMergeAtOnce(),
MergePolicyConfig.DEFAULT_MAX_MERGE_AT_ONCE
);
assertEquals(((OpenSearchTieredMergePolicy) indexSettings.getMergePolicy()).getMaxMergeAtOnceExplicit(), 30);
assertEquals(
((OpenSearchTieredMergePolicy) indexSettings.getMergePolicy()).getMaxMergedSegmentMB(),
new ByteSizeValue(MergePolicyConfig.DEFAULT_MAX_MERGED_SEGMENT.getBytes() + 1).getMbFrac(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,6 @@ public void testSetMaxMergeAtOnce() {
assertEquals(42, policy.regularMergePolicy.getMaxMergeAtOnce());
}

public void testSetMaxMergeAtOnceExplicit() {
OpenSearchTieredMergePolicy policy = new OpenSearchTieredMergePolicy();
policy.setMaxMergeAtOnceExplicit(42);
assertEquals(42, policy.forcedMergePolicy.getMaxMergeAtOnceExplicit());
}

public void testSetSegmentsPerTier() {
OpenSearchTieredMergePolicy policy = new OpenSearchTieredMergePolicy();
policy.setSegmentsPerTier(42);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
import org.apache.lucene.index.LeafReader;
import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.index.LiveIndexWriterConfig;
import org.apache.lucene.index.LogByteSizeMergePolicy;
import org.apache.lucene.index.LogDocMergePolicy;
import org.apache.lucene.index.MergePolicy;
import org.apache.lucene.index.NoMergePolicy;
Expand Down