Skip to content

Commit

Permalink
Add test ensure we can execute update requests in mixed cluster
Browse files Browse the repository at this point in the history
Relates #42596
  • Loading branch information
dnhatn committed May 27, 2019
1 parent 349d2ce commit 337cef1
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -567,4 +567,22 @@ private void ensureGlobalCheckpointSynced(String index) throws Exception {
});
}, 60, TimeUnit.SECONDS);
}

/** Ensure that we can always execute update requests regardless of the version of cluster */
public void testUpdateDoc() throws Exception {
final String index = "test_update_doc";
if (CLUSTER_TYPE == ClusterType.OLD) {
Settings.Builder settings = Settings.builder()
.put(IndexMetaData.INDEX_NUMBER_OF_SHARDS_SETTING.getKey(), 1)
.put(IndexMetaData.INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), 2);
createIndex(index, settings.build());
}
ensureGreen(index);
indexDocs(index, 0, 10);
for (int i = 0; i < 10; i++) {
Request update = new Request("POST", index + "/_update/" + i);
update.setJsonEntity("{\"doc\": {\"f\": " + randomNonNegativeLong() + "}}");
client().performRequest(update);
}
}
}

0 comments on commit 337cef1

Please sign in to comment.