Skip to content

Commit

Permalink
Don't update system index mappings in mixed clusters (#101778) (#101798)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
williamrandolph authored Nov 3, 2023
1 parent 6535363 commit d9ec3fa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
7 changes: 7 additions & 0 deletions docs/changelog/101778.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pr: 101778
summary: Don't update system index mappings in mixed clusters
area: Infra/Core
type: bug
issues:
- 101331
- 99778
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
package org.elasticsearch.upgrades;

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

private static String CLUSTER_NAME = System.getProperty("tests.clustername");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void clusterChanged(ClusterChangedEvent event) {
}

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

0 comments on commit d9ec3fa

Please sign in to comment.