Skip to content

Commit d9ec3fa

Browse files
Don't update system index mappings in mixed clusters (#101778) (#101798)
* Don't update system index mappings in mixed clusters #99668 seems to have introduced a bug where SystemIndexMappingUpdateService updates system index mappings even in mixed clusters. This PR restores the old version-based check in order to be sure that there's no update until the cluster is fully upgraded. The timing of the mapping update seems to be causing worse problems, corrupting persisted cluster state. Fixes #99778, #101331 * Remove broken assertion The compatibility versions objects are not showing up correctly, so we shouldn't assert on them.
1 parent 6535363 commit d9ec3fa

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

docs/changelog/101778.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
pr: 101778
2+
summary: Don't update system index mappings in mixed clusters
3+
area: Infra/Core
4+
type: bug
5+
issues:
6+
- 101331
7+
- 99778

qa/rolling-upgrade-legacy/src/test/java/org/elasticsearch/upgrades/RecoveryIT.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
package org.elasticsearch.upgrades;
99

1010
import org.apache.http.util.EntityUtils;
11-
import org.apache.lucene.tests.util.LuceneTestCase;
1211
import org.elasticsearch.Version;
1312
import org.elasticsearch.action.support.PlainActionFuture;
1413
import org.elasticsearch.client.Request;
@@ -53,7 +52,6 @@
5352
/**
5453
* In depth testing of the recovery mechanism during a rolling restart.
5554
*/
56-
@LuceneTestCase.AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/99778")
5755
public class RecoveryIT extends AbstractRollingTestCase {
5856

5957
private static String CLUSTER_NAME = System.getProperty("tests.clustername");

server/src/main/java/org/elasticsearch/indices/SystemIndexMappingUpdateService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public void clusterChanged(ClusterChangedEvent event) {
9292
}
9393

9494
// if we're in a mixed-version cluster, exit
95-
if (state.hasMixedSystemIndexVersions()) {
95+
if (state.nodes().getMaxNodeVersion().after(state.nodes().getSmallestNonClientNodeVersion())) {
9696
logger.debug("Skipping system indices up-to-date check as cluster has mixed versions");
9797
return;
9898
}

0 commit comments

Comments
 (0)