File tree 1 file changed +20
-0
lines changed
qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 30
30
import org .elasticsearch .common .xcontent .support .XContentMapValues ;
31
31
import org .elasticsearch .index .IndexSettings ;
32
32
import org .elasticsearch .rest .action .document .RestIndexAction ;
33
+ import org .elasticsearch .rest .action .document .RestUpdateAction ;
33
34
import org .elasticsearch .test .rest .yaml .ObjectPath ;
34
35
35
36
import java .io .IOException ;
@@ -334,4 +335,23 @@ public void testRecoveryWithSoftDeletes() throws Exception {
334
335
}
335
336
ensureGreen (index );
336
337
}
338
+
339
+ /** Ensure that we can always execute update requests regardless of the version of cluster */
340
+ public void testUpdateDoc () throws Exception {
341
+ final String index = "test_update_doc" ;
342
+ if (CLUSTER_TYPE == ClusterType .OLD ) {
343
+ Settings .Builder settings = Settings .builder ()
344
+ .put (IndexMetaData .INDEX_NUMBER_OF_SHARDS_SETTING .getKey (), 1 )
345
+ .put (IndexMetaData .INDEX_NUMBER_OF_REPLICAS_SETTING .getKey (), 2 );
346
+ createIndex (index , settings .build ());
347
+ }
348
+ ensureGreen (index );
349
+ indexDocs (index , 0 , 10 );
350
+ for (int i = 0 ; i < 10 ; i ++) {
351
+ Request update = new Request ("POST" , index + "/test/" + i + "/_update/" );
352
+ update .setOptions (expectWarnings (RestUpdateAction .TYPES_DEPRECATION_MESSAGE ));
353
+ update .setJsonEntity ("{\" doc\" : {\" f\" : " + randomNonNegativeLong () + "}}" );
354
+ client ().performRequest (update );
355
+ }
356
+ }
337
357
}
You can’t perform that action at this time.
0 commit comments