Skip to content
Open
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Fix flaky test FieldDataLoadingIT.testIndicesFieldDataCacheSizeSetting ([#19571](https://github.com/opensearch-project/OpenSearch/pull/19571))
- Avoid primary shard failure caused by merged segment warmer exceptions ([#19436](https://github.com/opensearch-project/OpenSearch/pull/19436))
- Fix pull-based ingestion out-of-bounds offset scenarios and remove persisted offsets ([#19607](https://github.com/opensearch-project/OpenSearch/pull/19607))
- Fix flaky test ClusterMaxMergesAtOnceIT.testClusterLevelDefaultUpdatesMergePolicy ([#18056](https://github.com/opensearch-project/OpenSearch/issues/18056))

### Dependencies
- Update to Gradle 9.1 ([#19575](https://github.com/opensearch-project/OpenSearch/pull/19575))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ public void setUp() throws Exception {
internalCluster().startClusterManagerOnlyNode();
}

@AwaitsFix(bugUrl = "https://github.com/opensearch-project/OpenSearch/issues/18056")
public void testClusterLevelDefaultUpdatesMergePolicy() throws ExecutionException, InterruptedException {
String clusterManagerName = internalCluster().getClusterManagerName();
List<String> dataNodes = new ArrayList<>(internalCluster().getDataNodeNames());
Expand Down Expand Up @@ -96,11 +95,15 @@ public void testClusterLevelDefaultUpdatesMergePolicy() throws ExecutionExceptio
assertEquals(20, ((OpenSearchTieredMergePolicy) indexService.getIndexSettings().getMergePolicy(true)).getMaxMergeAtOnce());
assertEquals(20, ((OpenSearchTieredMergePolicy) secondIndexService.getIndexSettings().getMergePolicy(true)).getMaxMergeAtOnce());

int replicas = randomIntBetween(1, Math.max(1, internalCluster().numDataNodes() - 1));
Copy link
Contributor

Choose a reason for hiding this comment

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

More for my own curiosity than anything -- how does this end up fixing the test?

By the default, the replica count would be 1, based on the implementation of indexSettings() on line 56. So I don't understand how setting the replica count to a random number between 1 and 1 (since it looks like numDataNodes = 2) changes anything.

I'm not particularly familiar with these tests, but I'm trying to understand more. Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe generating a random integer here is enough to change the random result from randomFrom(dataNodes) on line 108 (before)/111 (after)?

Copy link
Member

Choose a reason for hiding this comment

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

@msfroh I think you're right. I confirmed that just adding a randomInt() call here and doing nothing with the result is enough to make the test pass.

// Create index with index level override in settings
indexName = "log-myindex-3";
createIndex(
indexName,
Settings.builder().put(TieredMergePolicyProvider.INDEX_MERGE_POLICY_MAX_MERGE_AT_ONCE_SETTING.getKey(), 15).build()
Settings.builder()
.put(TieredMergePolicyProvider.INDEX_MERGE_POLICY_MAX_MERGE_AT_ONCE_SETTING.getKey(), 15)
.put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, replicas)
.build()
);
ensureYellowAndNoInitializingShards(indexName);
ensureGreen(indexName);
Expand Down
Loading