From 517b5ae322ed8f8882396f6ce4d1bb2ee3a71ce0 Mon Sep 17 00:00:00 2001 From: Andriy Redko Date: Fri, 10 Jun 2022 15:16:21 -0400 Subject: [PATCH 1/2] Update merge on refresh and merge on commit defaults in Opensearch (Lucene 9.3) Signed-off-by: Andriy Redko --- .../decider/DiskThresholdDeciderIT.java | 1 - .../common/settings/IndexScopedSettings.java | 1 + .../org/opensearch/index/IndexSettings.java | 43 +++++++++++++++++-- .../index/engine/InternalEngine.java | 16 +++---- .../opensearch/common/lucene/LuceneTests.java | 6 +-- .../index/engine/InternalEngineTests.java | 5 ++- .../index/shard/ShardGetServiceTests.java | 1 - .../index/engine/EngineTestCase.java | 1 + 8 files changed, 54 insertions(+), 20 deletions(-) diff --git a/server/src/internalClusterTest/java/org/opensearch/cluster/routing/allocation/decider/DiskThresholdDeciderIT.java b/server/src/internalClusterTest/java/org/opensearch/cluster/routing/allocation/decider/DiskThresholdDeciderIT.java index 45daea3d066d3..fcfcec3445a80 100644 --- a/server/src/internalClusterTest/java/org/opensearch/cluster/routing/allocation/decider/DiskThresholdDeciderIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/cluster/routing/allocation/decider/DiskThresholdDeciderIT.java @@ -153,7 +153,6 @@ protected Collection> nodePlugins() { return Collections.singletonList(InternalSettingsPlugin.class); } - @AwaitsFix(bugUrl = "https://github.com/opensearch-project/OpenSearch/pull/3561") public void testHighWatermarkNotExceeded() throws Exception { internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); diff --git a/server/src/main/java/org/opensearch/common/settings/IndexScopedSettings.java b/server/src/main/java/org/opensearch/common/settings/IndexScopedSettings.java index e6a82d36a18a9..a2aac1f2c54c5 100644 --- a/server/src/main/java/org/opensearch/common/settings/IndexScopedSettings.java +++ b/server/src/main/java/org/opensearch/common/settings/IndexScopedSettings.java @@ -194,6 +194,7 @@ public final class IndexScopedSettings extends AbstractScopedSettings { ExistingShardsAllocator.EXISTING_SHARDS_ALLOCATOR_SETTING, IndexSettings.INDEX_MERGE_ON_FLUSH_ENABLED, IndexSettings.INDEX_MERGE_ON_FLUSH_MAX_FULL_FLUSH_MERGE_WAIT_TIME, + IndexSettings.INDEX_MERGE_ON_FLUSH_POLICY, // validate that built-in similarities don't get redefined Setting.groupSetting("index.similarity.", (s) -> { diff --git a/server/src/main/java/org/opensearch/index/IndexSettings.java b/server/src/main/java/org/opensearch/index/IndexSettings.java index eb8ba98e61890..a7dd8ba99de97 100644 --- a/server/src/main/java/org/opensearch/index/IndexSettings.java +++ b/server/src/main/java/org/opensearch/index/IndexSettings.java @@ -32,11 +32,12 @@ package org.opensearch.index; import org.apache.logging.log4j.Logger; -import org.apache.logging.log4j.util.Strings; import org.apache.lucene.index.MergePolicy; +import org.apache.lucene.sandbox.index.MergeOnFlushMergePolicy; import org.opensearch.LegacyESVersion; import org.opensearch.Version; import org.opensearch.cluster.metadata.IndexMetadata; +import org.opensearch.common.Strings; import org.opensearch.common.logging.Loggers; import org.opensearch.common.settings.IndexScopedSettings; import org.opensearch.common.settings.Setting; @@ -53,6 +54,7 @@ import java.util.Collections; import java.util.List; import java.util.Locale; +import java.util.Optional; import java.util.concurrent.TimeUnit; import java.util.function.Consumer; import java.util.function.Function; @@ -526,14 +528,21 @@ public final class IndexSettings { public static final Setting INDEX_MERGE_ON_FLUSH_MAX_FULL_FLUSH_MERGE_WAIT_TIME = Setting.timeSetting( "index.merge_on_flush.max_full_flush_merge_wait_time", new TimeValue(10, TimeUnit.SECONDS), - new TimeValue(0, TimeUnit.MILLISECONDS), + new TimeValue(1, TimeUnit.MILLISECONDS), Property.Dynamic, Property.IndexScope ); public static final Setting INDEX_MERGE_ON_FLUSH_ENABLED = Setting.boolSetting( "index.merge_on_flush.enabled", - false, + true, /* https://issues.apache.org/jira/browse/LUCENE-10078 */ + Property.IndexScope, + Property.Dynamic + ); + + public static final Setting INDEX_MERGE_ON_FLUSH_POLICY = Setting.simpleString( + "index.merge_on_flush.policy", + "default", Property.IndexScope, Property.Dynamic ); @@ -632,6 +641,10 @@ private void setRetentionLeaseMillis(final TimeValue retentionLease) { * Is merge of flush enabled or not */ private volatile boolean mergeOnFlushEnabled; + /** + * Specialized merge-on-flush policy if provided + */ + private volatile Function mergeOnFlushPolicy; /** * Returns the default search fields for this index. @@ -750,6 +763,7 @@ public IndexSettings(final IndexMetadata indexMetadata, final Settings nodeSetti mappingFieldNameLengthLimit = scopedSettings.get(INDEX_MAPPING_FIELD_NAME_LENGTH_LIMIT_SETTING); maxFullFlushMergeWaitTime = scopedSettings.get(INDEX_MERGE_ON_FLUSH_MAX_FULL_FLUSH_MERGE_WAIT_TIME); mergeOnFlushEnabled = scopedSettings.get(INDEX_MERGE_ON_FLUSH_ENABLED); + setMergeOnFlushPolicy(scopedSettings.get(INDEX_MERGE_ON_FLUSH_POLICY)); scopedSettings.addSettingsUpdateConsumer(MergePolicyConfig.INDEX_COMPOUND_FORMAT_SETTING, mergePolicyConfig::setNoCFSRatio); scopedSettings.addSettingsUpdateConsumer( @@ -822,6 +836,7 @@ public IndexSettings(final IndexMetadata indexMetadata, final Settings nodeSetti scopedSettings.addSettingsUpdateConsumer(INDEX_MAPPING_FIELD_NAME_LENGTH_LIMIT_SETTING, this::setMappingFieldNameLengthLimit); scopedSettings.addSettingsUpdateConsumer(INDEX_MERGE_ON_FLUSH_MAX_FULL_FLUSH_MERGE_WAIT_TIME, this::setMaxFullFlushMergeWaitTime); scopedSettings.addSettingsUpdateConsumer(INDEX_MERGE_ON_FLUSH_ENABLED, this::setMergeOnFlushEnabled); + scopedSettings.addSettingsUpdateConsumer(INDEX_MERGE_ON_FLUSH_POLICY, this::setMergeOnFlushPolicy); } private void setSearchIdleAfter(TimeValue searchIdleAfter) { @@ -892,7 +907,7 @@ public String getUUID() { * Returns true if the index has a custom data path */ public boolean hasCustomDataPath() { - return Strings.isNotEmpty(customDataPath()); + return !Strings.isEmpty(customDataPath()); } /** @@ -1426,4 +1441,24 @@ public TimeValue getMaxFullFlushMergeWaitTime() { public boolean isMergeOnFlushEnabled() { return mergeOnFlushEnabled; } + + private void setMergeOnFlushPolicy(String policy) { + if (Strings.isEmpty(policy) || "default".equalsIgnoreCase(policy)) { + mergeOnFlushPolicy = null; + } else if ("merge-on-flush".equalsIgnoreCase(policy)) { + this.mergeOnFlushPolicy = MergeOnFlushMergePolicy::new; + } else { + throw new IllegalArgumentException( + "The " + + IndexSettings.INDEX_MERGE_ON_FLUSH_POLICY.getKey() + + " has unsupported policy specified: " + + policy + + ". Please use one of: default, merge-on-flush" + ); + } + } + + public Optional> getMergeOnFlushPolicy() { + return Optional.ofNullable(mergeOnFlushPolicy); + } } diff --git a/server/src/main/java/org/opensearch/index/engine/InternalEngine.java b/server/src/main/java/org/opensearch/index/engine/InternalEngine.java index 69a168eb04ac7..95af0490b1c4f 100644 --- a/server/src/main/java/org/opensearch/index/engine/InternalEngine.java +++ b/server/src/main/java/org/opensearch/index/engine/InternalEngine.java @@ -50,7 +50,6 @@ import org.apache.lucene.index.SoftDeletesRetentionMergePolicy; import org.apache.lucene.index.StandardDirectoryReader; import org.apache.lucene.index.Term; -import org.apache.lucene.sandbox.index.MergeOnFlushMergePolicy; import org.apache.lucene.search.BooleanClause; import org.apache.lucene.search.BooleanQuery; import org.apache.lucene.search.DocIdSetIterator; @@ -133,6 +132,7 @@ import java.util.concurrent.locks.ReentrantLock; import java.util.function.BiConsumer; import java.util.function.BiFunction; +import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -2295,14 +2295,14 @@ private IndexWriterConfig getIndexWriterConfig() { final long maxFullFlushMergeWaitMillis = config().getIndexSettings().getMaxFullFlushMergeWaitTime().millis(); if (maxFullFlushMergeWaitMillis > 0) { iwc.setMaxFullFlushMergeWaitMillis(maxFullFlushMergeWaitMillis); - mergePolicy = new MergeOnFlushMergePolicy(mergePolicy); - } else { - logger.warn( - "The {} is enabled but {} is set to 0, merge on flush will not be activated", - IndexSettings.INDEX_MERGE_ON_FLUSH_ENABLED.getKey(), - IndexSettings.INDEX_MERGE_ON_FLUSH_MAX_FULL_FLUSH_MERGE_WAIT_TIME.getKey() - ); + final Optional> mergeOnFlushPolicy = config().getIndexSettings().getMergeOnFlushPolicy(); + if (mergeOnFlushPolicy.isPresent()) { + mergePolicy = mergeOnFlushPolicy.get().apply(mergePolicy); + } } + } else { + // Disable merge on refresh + iwc.setMaxFullFlushMergeWaitMillis(0); } iwc.setMergePolicy(new OpenSearchMergePolicy(mergePolicy)); diff --git a/server/src/test/java/org/opensearch/common/lucene/LuceneTests.java b/server/src/test/java/org/opensearch/common/lucene/LuceneTests.java index 776b44d346fb5..0edcd55cc35c3 100644 --- a/server/src/test/java/org/opensearch/common/lucene/LuceneTests.java +++ b/server/src/test/java/org/opensearch/common/lucene/LuceneTests.java @@ -590,10 +590,8 @@ public void testWrapAllDocsLive() throws Exception { public void testWrapLiveDocsNotExposeAbortedDocuments() throws Exception { Directory dir = newDirectory(); IndexWriterConfig config = newIndexWriterConfig().setSoftDeletesField(Lucene.SOFT_DELETES_FIELD) - .setMergePolicy(new SoftDeletesRetentionMergePolicy(Lucene.SOFT_DELETES_FIELD, MatchAllDocsQuery::new, newMergePolicy())); - // override 500ms default introduced in - // https://issues.apache.org/jira/browse/LUCENE-10078 - config.setMaxFullFlushMergeWaitMillis(0); + .setMergePolicy(new SoftDeletesRetentionMergePolicy(Lucene.SOFT_DELETES_FIELD, MatchAllDocsQuery::new, newMergePolicy())) + .setMaxFullFlushMergeWaitMillis(0); IndexWriter writer = new IndexWriter(dir, config); int numDocs = between(1, 10); List liveDocs = new ArrayList<>(); diff --git a/server/src/test/java/org/opensearch/index/engine/InternalEngineTests.java b/server/src/test/java/org/opensearch/index/engine/InternalEngineTests.java index 918fc91e7076f..2928cf823841c 100644 --- a/server/src/test/java/org/opensearch/index/engine/InternalEngineTests.java +++ b/server/src/test/java/org/opensearch/index/engine/InternalEngineTests.java @@ -503,8 +503,7 @@ public void testMergeSegmentsOnCommitIsDisabled() throws Exception { final Settings.Builder settings = Settings.builder() .put(defaultSettings.getSettings()) - .put(IndexSettings.INDEX_MERGE_ON_FLUSH_MAX_FULL_FLUSH_MERGE_WAIT_TIME.getKey(), TimeValue.timeValueMillis(0)) - .put(IndexSettings.INDEX_MERGE_ON_FLUSH_ENABLED.getKey(), true); + .put(IndexSettings.INDEX_MERGE_ON_FLUSH_ENABLED.getKey(), false); final IndexMetadata indexMetadata = IndexMetadata.builder(defaultSettings.getIndexMetadata()).settings(settings).build(); final IndexSettings indexSettings = IndexSettingsModule.newIndexSettings(indexMetadata); @@ -576,6 +575,7 @@ public void testMergeSegmentsOnCommit() throws Exception { final Settings.Builder settings = Settings.builder() .put(defaultSettings.getSettings()) .put(IndexSettings.INDEX_MERGE_ON_FLUSH_MAX_FULL_FLUSH_MERGE_WAIT_TIME.getKey(), TimeValue.timeValueMillis(5000)) + .put(IndexSettings.INDEX_MERGE_ON_FLUSH_POLICY.getKey(), "merge-on-flush") .put(IndexSettings.INDEX_MERGE_ON_FLUSH_ENABLED.getKey(), true); final IndexMetadata indexMetadata = IndexMetadata.builder(defaultSettings.getIndexMetadata()).settings(settings).build(); final IndexSettings indexSettings = IndexSettingsModule.newIndexSettings(indexMetadata); @@ -645,6 +645,7 @@ public void testConcurrentMergeSegmentsOnCommit() throws Exception { final Settings.Builder settings = Settings.builder() .put(defaultSettings.getSettings()) .put(IndexSettings.INDEX_MERGE_ON_FLUSH_MAX_FULL_FLUSH_MERGE_WAIT_TIME.getKey(), TimeValue.timeValueMillis(5000)) + .put(IndexSettings.INDEX_MERGE_ON_FLUSH_POLICY.getKey(), "merge-on-flush") .put(IndexSettings.INDEX_MERGE_ON_FLUSH_ENABLED.getKey(), true); final IndexMetadata indexMetadata = IndexMetadata.builder(defaultSettings.getIndexMetadata()).settings(settings).build(); final IndexSettings indexSettings = IndexSettingsModule.newIndexSettings(indexMetadata); diff --git a/server/src/test/java/org/opensearch/index/shard/ShardGetServiceTests.java b/server/src/test/java/org/opensearch/index/shard/ShardGetServiceTests.java index 5dd053574268e..f29303ce8dda1 100644 --- a/server/src/test/java/org/opensearch/index/shard/ShardGetServiceTests.java +++ b/server/src/test/java/org/opensearch/index/shard/ShardGetServiceTests.java @@ -56,7 +56,6 @@ public void testGetForUpdate() throws IOException { .put(IndexMetadata.SETTING_VERSION_CREATED, Version.CURRENT) .put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 1) .put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1) - .build(); IndexMetadata metadata = IndexMetadata.builder("test") .putMapping("{ \"properties\": { \"foo\": { \"type\": \"text\"}}}") diff --git a/test/framework/src/main/java/org/opensearch/index/engine/EngineTestCase.java b/test/framework/src/main/java/org/opensearch/index/engine/EngineTestCase.java index 174747d306ff5..a8dddbe993fd2 100644 --- a/test/framework/src/main/java/org/opensearch/index/engine/EngineTestCase.java +++ b/test/framework/src/main/java/org/opensearch/index/engine/EngineTestCase.java @@ -202,6 +202,7 @@ protected Settings indexSettings() { between(10, 10 * IndexSettings.MAX_REFRESH_LISTENERS_PER_SHARD.get(Settings.EMPTY)) ) .put(IndexSettings.INDEX_SOFT_DELETES_RETENTION_OPERATIONS_SETTING.getKey(), between(0, 1000)) + .put(IndexSettings.INDEX_MERGE_ON_FLUSH_ENABLED.getKey(), false) .build(); } From aa8e8d46978f5ea8acaf9a2d84445e1dc61f2b86 Mon Sep 17 00:00:00 2001 From: Andriy Redko Date: Tue, 14 Jun 2022 12:32:56 -0400 Subject: [PATCH 2/2] Addressing code review comments, adding more tests Signed-off-by: Andriy Redko --- .../org/opensearch/index/IndexSettings.java | 19 +++++--- .../index/engine/InternalEngine.java | 4 +- .../index/engine/InternalEngineTests.java | 44 +++++++++++++++++-- .../index/engine/EngineTestCase.java | 1 - 4 files changed, 55 insertions(+), 13 deletions(-) diff --git a/server/src/main/java/org/opensearch/index/IndexSettings.java b/server/src/main/java/org/opensearch/index/IndexSettings.java index a7dd8ba99de97..7c9b9755a2434 100644 --- a/server/src/main/java/org/opensearch/index/IndexSettings.java +++ b/server/src/main/java/org/opensearch/index/IndexSettings.java @@ -58,6 +58,7 @@ import java.util.concurrent.TimeUnit; import java.util.function.Consumer; import java.util.function.Function; +import java.util.function.UnaryOperator; import static org.opensearch.index.mapper.MapperService.INDEX_MAPPING_DEPTH_LIMIT_SETTING; import static org.opensearch.index.mapper.MapperService.INDEX_MAPPING_FIELD_NAME_LENGTH_LIMIT_SETTING; @@ -75,6 +76,9 @@ * @opensearch.internal */ public final class IndexSettings { + private static final String MERGE_ON_FLUSH_DEFAULT_POLICY = "default"; + private static final String MERGE_ON_FLUSH_MERGE_POLICY = "merge-on-flush"; + public static final Setting> DEFAULT_FIELD_SETTING = Setting.listSetting( "index.query.default_field", Collections.singletonList("*"), @@ -542,7 +546,7 @@ public final class IndexSettings { public static final Setting INDEX_MERGE_ON_FLUSH_POLICY = Setting.simpleString( "index.merge_on_flush.policy", - "default", + MERGE_ON_FLUSH_DEFAULT_POLICY, Property.IndexScope, Property.Dynamic ); @@ -644,7 +648,7 @@ private void setRetentionLeaseMillis(final TimeValue retentionLease) { /** * Specialized merge-on-flush policy if provided */ - private volatile Function mergeOnFlushPolicy; + private volatile UnaryOperator mergeOnFlushPolicy; /** * Returns the default search fields for this index. @@ -1443,9 +1447,9 @@ public boolean isMergeOnFlushEnabled() { } private void setMergeOnFlushPolicy(String policy) { - if (Strings.isEmpty(policy) || "default".equalsIgnoreCase(policy)) { + if (Strings.isEmpty(policy) || MERGE_ON_FLUSH_DEFAULT_POLICY.equalsIgnoreCase(policy)) { mergeOnFlushPolicy = null; - } else if ("merge-on-flush".equalsIgnoreCase(policy)) { + } else if (MERGE_ON_FLUSH_MERGE_POLICY.equalsIgnoreCase(policy)) { this.mergeOnFlushPolicy = MergeOnFlushMergePolicy::new; } else { throw new IllegalArgumentException( @@ -1453,12 +1457,15 @@ private void setMergeOnFlushPolicy(String policy) { + IndexSettings.INDEX_MERGE_ON_FLUSH_POLICY.getKey() + " has unsupported policy specified: " + policy - + ". Please use one of: default, merge-on-flush" + + ". Please use one of: " + + MERGE_ON_FLUSH_DEFAULT_POLICY + + ", " + + MERGE_ON_FLUSH_MERGE_POLICY ); } } - public Optional> getMergeOnFlushPolicy() { + public Optional> getMergeOnFlushPolicy() { return Optional.ofNullable(mergeOnFlushPolicy); } } diff --git a/server/src/main/java/org/opensearch/index/engine/InternalEngine.java b/server/src/main/java/org/opensearch/index/engine/InternalEngine.java index 95af0490b1c4f..7d90c2ad653be 100644 --- a/server/src/main/java/org/opensearch/index/engine/InternalEngine.java +++ b/server/src/main/java/org/opensearch/index/engine/InternalEngine.java @@ -132,7 +132,7 @@ import java.util.concurrent.locks.ReentrantLock; import java.util.function.BiConsumer; import java.util.function.BiFunction; -import java.util.function.Function; +import java.util.function.UnaryOperator; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -2295,7 +2295,7 @@ private IndexWriterConfig getIndexWriterConfig() { final long maxFullFlushMergeWaitMillis = config().getIndexSettings().getMaxFullFlushMergeWaitTime().millis(); if (maxFullFlushMergeWaitMillis > 0) { iwc.setMaxFullFlushMergeWaitMillis(maxFullFlushMergeWaitMillis); - final Optional> mergeOnFlushPolicy = config().getIndexSettings().getMergeOnFlushPolicy(); + final Optional> mergeOnFlushPolicy = config().getIndexSettings().getMergeOnFlushPolicy(); if (mergeOnFlushPolicy.isPresent()) { mergePolicy = mergeOnFlushPolicy.get().apply(mergePolicy); } diff --git a/server/src/test/java/org/opensearch/index/engine/InternalEngineTests.java b/server/src/test/java/org/opensearch/index/engine/InternalEngineTests.java index 2928cf823841c..28a420403bcc1 100644 --- a/server/src/test/java/org/opensearch/index/engine/InternalEngineTests.java +++ b/server/src/test/java/org/opensearch/index/engine/InternalEngineTests.java @@ -575,8 +575,7 @@ public void testMergeSegmentsOnCommit() throws Exception { final Settings.Builder settings = Settings.builder() .put(defaultSettings.getSettings()) .put(IndexSettings.INDEX_MERGE_ON_FLUSH_MAX_FULL_FLUSH_MERGE_WAIT_TIME.getKey(), TimeValue.timeValueMillis(5000)) - .put(IndexSettings.INDEX_MERGE_ON_FLUSH_POLICY.getKey(), "merge-on-flush") - .put(IndexSettings.INDEX_MERGE_ON_FLUSH_ENABLED.getKey(), true); + .put(IndexSettings.INDEX_MERGE_ON_FLUSH_POLICY.getKey(), "merge-on-flush"); final IndexMetadata indexMetadata = IndexMetadata.builder(defaultSettings.getIndexMetadata()).settings(settings).build(); final IndexSettings indexSettings = IndexSettingsModule.newIndexSettings(indexMetadata); @@ -638,6 +637,44 @@ public void testMergeSegmentsOnCommit() throws Exception { } } + public void testMergeSegmentsOnCommitDefault() throws Exception { + final AtomicLong globalCheckpoint = new AtomicLong(SequenceNumbers.NO_OPS_PERFORMED); + + final Settings.Builder settings = Settings.builder().put(defaultSettings.getSettings()); + final IndexMetadata indexMetadata = IndexMetadata.builder(defaultSettings.getIndexMetadata()).settings(settings).build(); + final IndexSettings indexSettings = IndexSettingsModule.newIndexSettings(indexMetadata); + + final TieredMergePolicy mergePolicy = new TieredMergePolicy(); + mergePolicy.setSegmentsPerTier(2); + + try ( + Store store = createStore(); + InternalEngine engine = createEngine( + config(indexSettings, store, createTempDir(), mergePolicy, null, null, globalCheckpoint::get) + ) + ) { + List segments = engine.segments(true); + assertThat(segments.isEmpty(), equalTo(true)); + + ParsedDocument doc = testParsedDocument("1", null, testDocumentWithTextField(), B_1, null); + engine.index(indexForDoc(doc)); + engine.refresh("test"); + + segments = engine.segments(true); + assertThat(segments.size(), equalTo(1)); + + ParsedDocument doc2 = testParsedDocument("2", null, testDocumentWithTextField(), B_2, null); + engine.index(indexForDoc(doc2)); + engine.refresh("test"); + ParsedDocument doc3 = testParsedDocument("3", null, testDocumentWithTextField(), B_3, null); + engine.index(indexForDoc(doc3)); + engine.refresh("test"); + + segments = engine.segments(true); + assertThat(segments.size(), equalTo(2)); + } + } + // this test writes documents to the engine while concurrently flushing/commit public void testConcurrentMergeSegmentsOnCommit() throws Exception { final AtomicLong globalCheckpoint = new AtomicLong(SequenceNumbers.NO_OPS_PERFORMED); @@ -645,8 +682,7 @@ public void testConcurrentMergeSegmentsOnCommit() throws Exception { final Settings.Builder settings = Settings.builder() .put(defaultSettings.getSettings()) .put(IndexSettings.INDEX_MERGE_ON_FLUSH_MAX_FULL_FLUSH_MERGE_WAIT_TIME.getKey(), TimeValue.timeValueMillis(5000)) - .put(IndexSettings.INDEX_MERGE_ON_FLUSH_POLICY.getKey(), "merge-on-flush") - .put(IndexSettings.INDEX_MERGE_ON_FLUSH_ENABLED.getKey(), true); + .put(IndexSettings.INDEX_MERGE_ON_FLUSH_POLICY.getKey(), "merge-on-flush"); final IndexMetadata indexMetadata = IndexMetadata.builder(defaultSettings.getIndexMetadata()).settings(settings).build(); final IndexSettings indexSettings = IndexSettingsModule.newIndexSettings(indexMetadata); diff --git a/test/framework/src/main/java/org/opensearch/index/engine/EngineTestCase.java b/test/framework/src/main/java/org/opensearch/index/engine/EngineTestCase.java index a8dddbe993fd2..174747d306ff5 100644 --- a/test/framework/src/main/java/org/opensearch/index/engine/EngineTestCase.java +++ b/test/framework/src/main/java/org/opensearch/index/engine/EngineTestCase.java @@ -202,7 +202,6 @@ protected Settings indexSettings() { between(10, 10 * IndexSettings.MAX_REFRESH_LISTENERS_PER_SHARD.get(Settings.EMPTY)) ) .put(IndexSettings.INDEX_SOFT_DELETES_RETENTION_OPERATIONS_SETTING.getKey(), between(0, 1000)) - .put(IndexSettings.INDEX_MERGE_ON_FLUSH_ENABLED.getKey(), false) .build(); }