Skip to content

Commit 548a66a

Browse files
committed
CCR follower index needs to copy transport version from CCR leader index (elastic#145035)
Currently, when adding a follower index to a leader index using CCR, transport version is not copied which leads to errors in the upgrade assistant.
1 parent 3acc5de commit 548a66a

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

docs/changelog/145035.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
area: CCR
2+
issues: []
3+
pr: 145035
4+
summary: CCR follower index needs to copy transport version from CCR leader index
5+
type: bug

x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/CcrRepositoryIT.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ public void testThatRepositoryRecoversEmptyIndexBasedOnLeaderSettings() throws I
199199

200200
// UUID is changed so that we can follow indexes on same cluster
201201
assertNotEquals(leaderMetadata.getIndexUUID(), followerMetadata.getIndexUUID());
202+
assertEquals(leaderMetadata.getTransportVersion(), followerMetadata.getTransportVersion());
202203
}
203204

204205
public void testDocsAreRecovered() throws Exception {

x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/repository/CcrRepository.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ public IndexMetadata getSnapshotIndexMetaData(RepositoryData repositoryData, Sna
309309
imdBuilder.putCustom(Ccr.CCR_CUSTOM_METADATA_KEY, customMetadata);
310310

311311
imdBuilder.settings(leaderIndexMetadata.getSettings());
312+
imdBuilder.transportVersion(leaderIndexMetadata.getTransportVersion());
312313

313314
// Copy mappings from leader IMD to follow IMD
314315
imdBuilder.putMapping(leaderIndexMetadata.mapping());

0 commit comments

Comments
 (0)