Skip to content

Commit 09b46c8

Browse files
authored
Goodbye and thank you synced flush! (#50882)
Synced flush was a brilliant idea. It supports instant recoveries with a quite small implementation. However, with the presence of sequence numbers and retention leases, it is no longer needed. This change removes it from 8.0. Relates #5077
1 parent adb56e5 commit 09b46c8

File tree

53 files changed

+290
-3731
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+290
-3731
lines changed

client/rest-high-level/src/main/java/org/elasticsearch/client/IndicesClient.java

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest;
2828
import org.elasticsearch.action.admin.indices.flush.FlushRequest;
2929
import org.elasticsearch.action.admin.indices.flush.FlushResponse;
30-
import org.elasticsearch.action.admin.indices.flush.SyncedFlushRequest;
3130
import org.elasticsearch.action.admin.indices.forcemerge.ForceMergeRequest;
3231
import org.elasticsearch.action.admin.indices.forcemerge.ForceMergeResponse;
3332
import org.elasticsearch.action.admin.indices.open.OpenIndexRequest;
@@ -415,41 +414,6 @@ public Cancellable flushAsync(FlushRequest flushRequest, RequestOptions options,
415414
FlushResponse::fromXContent, listener, emptySet());
416415
}
417416

418-
/**
419-
* Initiate a synced flush manually using the synced flush API.
420-
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-synced-flush-api.html">
421-
* Synced flush API on elastic.co</a>
422-
* @param syncedFlushRequest the request
423-
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
424-
* @return the response
425-
* @throws IOException in case there is a problem sending the request or parsing back the response
426-
* @deprecated synced flush is deprecated and will be removed in 8.0.
427-
* Use {@link #flush(FlushRequest, RequestOptions)} instead.
428-
*/
429-
@Deprecated
430-
public SyncedFlushResponse flushSynced(SyncedFlushRequest syncedFlushRequest, RequestOptions options) throws IOException {
431-
return restHighLevelClient.performRequestAndParseEntity(syncedFlushRequest, IndicesRequestConverters::flushSynced, options,
432-
SyncedFlushResponse::fromXContent, emptySet());
433-
}
434-
435-
/**
436-
* Asynchronously initiate a synced flush manually using the synced flush API.
437-
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-synced-flush-api.html">
438-
* Synced flush API on elastic.co</a>
439-
* @param syncedFlushRequest the request
440-
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
441-
* @param listener the listener to be notified upon request completion
442-
* @return cancellable that may be used to cancel the request
443-
* @deprecated synced flush is deprecated and will be removed in 8.0.
444-
* Use {@link #flushAsync(FlushRequest, RequestOptions, ActionListener)} instead.
445-
*/
446-
@Deprecated
447-
public Cancellable flushSyncedAsync(SyncedFlushRequest syncedFlushRequest, RequestOptions options,
448-
ActionListener<SyncedFlushResponse> listener) {
449-
return restHighLevelClient.performRequestAsyncAndParseEntity(syncedFlushRequest, IndicesRequestConverters::flushSynced, options,
450-
SyncedFlushResponse::fromXContent, listener, emptySet());
451-
}
452-
453417
/**
454418
* Retrieve the settings of one or more indices.
455419
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-settings.html">

client/rest-high-level/src/main/java/org/elasticsearch/client/IndicesRequestConverters.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import org.elasticsearch.action.admin.indices.cache.clear.ClearIndicesCacheRequest;
3030
import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest;
3131
import org.elasticsearch.action.admin.indices.flush.FlushRequest;
32-
import org.elasticsearch.action.admin.indices.flush.SyncedFlushRequest;
3332
import org.elasticsearch.action.admin.indices.forcemerge.ForceMergeRequest;
3433
import org.elasticsearch.action.admin.indices.open.OpenIndexRequest;
3534
import org.elasticsearch.action.admin.indices.refresh.RefreshRequest;
@@ -194,15 +193,6 @@ static Request flush(FlushRequest flushRequest) {
194193
return request;
195194
}
196195

197-
static Request flushSynced(SyncedFlushRequest syncedFlushRequest) {
198-
String[] indices = syncedFlushRequest.indices() == null ? Strings.EMPTY_ARRAY : syncedFlushRequest.indices();
199-
Request request = new Request(HttpPost.METHOD_NAME, RequestConverters.endpoint(indices, "_flush/synced"));
200-
RequestConverters.Params parameters = new RequestConverters.Params();
201-
parameters.withIndicesOptions(syncedFlushRequest.indicesOptions());
202-
request.addParameters(parameters.asMap());
203-
return request;
204-
}
205-
206196
static Request forceMerge(ForceMergeRequest forceMergeRequest) {
207197
String[] indices = forceMergeRequest.indices() == null ? Strings.EMPTY_ARRAY : forceMergeRequest.indices();
208198
Request request = new Request(HttpPost.METHOD_NAME, RequestConverters.endpoint(indices, "_forcemerge"));

0 commit comments

Comments
 (0)