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

Fix Clone Index setting override for replication type #16076

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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 @@ -40,6 +40,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Fix search_as_you_type not supporting multi-fields ([#15988](https://github.com/opensearch-project/OpenSearch/pull/15988))
- Avoid infinite loop when `flat_object` field contains invalid token ([#15985](https://github.com/opensearch-project/OpenSearch/pull/15985))
- Fix infinite loop in nested agg ([#15931](https://github.com/opensearch-project/OpenSearch/pull/15931))
- Fix Clone Index setting override for replication type ([#16076](https://github.com/opensearch-project/OpenSearch/pull/16076))

### Security

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1708,7 +1708,8 @@ static void prepareResizeIndexSettings(
.put(builder.build())
.put(IndexMetadata.SETTING_ROUTING_PARTITION_SIZE, sourceMetadata.getRoutingPartitionSize())
.put(IndexMetadata.INDEX_RESIZE_SOURCE_NAME.getKey(), resizeSourceIndex.getName())
.put(IndexMetadata.INDEX_RESIZE_SOURCE_UUID.getKey(), resizeSourceIndex.getUUID());
.put(IndexMetadata.INDEX_RESIZE_SOURCE_UUID.getKey(), resizeSourceIndex.getUUID())
.put(INDEX_REPLICATION_TYPE_SETTING.getKey(), INDEX_REPLICATION_TYPE_SETTING.get(sourceMetadata.getSettings()));
gaobinlong marked this conversation as resolved.
Show resolved Hide resolved
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,20 @@ public void testPrepareResizeIndexSettingsCopySettings() {
);
}

public void testPrepareResizeIndexSettingsReplicationType() {
gaobinlong marked this conversation as resolved.
Show resolved Hide resolved
runPrepareResizeIndexSettingsTest(
Settings.builder().put(SETTING_REPLICATION_TYPE, ReplicationType.SEGMENT.toString()).build(),
Settings.builder().put(SETTING_REPLICATION_TYPE, ReplicationType.DOCUMENT.toString()).build(),
emptyList(),
true,
settings -> assertThat(
"Segment Replication must be equal to source type",
settings.get(SETTING_REPLICATION_TYPE),
equalTo(ReplicationType.SEGMENT.toString())
)
);
}

public void testPrepareResizeIndexSettingsAnalysisSettings() {
// analysis settings from the request are not overwritten
runPrepareResizeIndexSettingsTest(
Expand Down
Loading