Skip to content

Commit

Permalink
Upgrade: Change wait_for_completion to default to true
Browse files Browse the repository at this point in the history
This has ended up being very trappy.  Most people don't realize the
parameter is there, and using a wildcard on index names for upgrade
will end up essentially bypassing the optimize concurrency controls
through its threadpool.

See elastic#9638
  • Loading branch information
rjernst committed Feb 10, 2015
1 parent f1b9e73 commit c60d620
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/reference/indices/upgrade.asciidoc
Expand Up @@ -25,7 +25,7 @@ The `upgrade` API accepts the following request parameters:

[horizontal]
`wait_for_completion`:: Should the request wait for the upgrade to complete. Defaults
to `false`.
to `true`.

[float]
=== Check upgrade status
Expand Down
Expand Up @@ -90,7 +90,7 @@ public RestResponse buildResponse(IndicesSegmentResponse response, XContentBuild

void handlePost(RestRequest request, RestChannel channel, Client client) {
OptimizeRequest optimizeReq = new OptimizeRequest(Strings.splitStringByCommaToArray(request.param("index")));
optimizeReq.waitForMerge(request.paramAsBoolean("wait_for_completion", false));
optimizeReq.waitForMerge(request.paramAsBoolean("wait_for_completion", true));
optimizeReq.flush(true);
optimizeReq.upgrade(true);
optimizeReq.maxNumSegments(Integer.MAX_VALUE); // we just want to upgrade the segments, not actually optimize to a single segment
Expand Down

0 comments on commit c60d620

Please sign in to comment.