File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments