Skip to content

Commit 337cef1

Browse files
committed
Add test ensure we can execute update requests in mixed cluster
Relates #42596
1 parent 349d2ce commit 337cef1

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,4 +567,22 @@ private void ensureGlobalCheckpointSynced(String index) throws Exception {
567567
});
568568
}, 60, TimeUnit.SECONDS);
569569
}
570+
571+
/** Ensure that we can always execute update requests regardless of the version of cluster */
572+
public void testUpdateDoc() throws Exception {
573+
final String index = "test_update_doc";
574+
if (CLUSTER_TYPE == ClusterType.OLD) {
575+
Settings.Builder settings = Settings.builder()
576+
.put(IndexMetaData.INDEX_NUMBER_OF_SHARDS_SETTING.getKey(), 1)
577+
.put(IndexMetaData.INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), 2);
578+
createIndex(index, settings.build());
579+
}
580+
ensureGreen(index);
581+
indexDocs(index, 0, 10);
582+
for (int i = 0; i < 10; i++) {
583+
Request update = new Request("POST", index + "/_update/" + i);
584+
update.setJsonEntity("{\"doc\": {\"f\": " + randomNonNegativeLong() + "}}");
585+
client().performRequest(update);
586+
}
587+
}
570588
}

0 commit comments

Comments
 (0)