Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove endpoint for freezing indices #77273

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
36566ec
Remove endpoint for freezing indices
danhermann Sep 3, 2021
d0feafc
Merge branch 'master' into 70192_remove_freeze_endpoint
elasticmachine Sep 3, 2021
03d4d21
disable REST compat tests
danhermann Sep 3, 2021
aebcd45
remove freeze test
danhermann Sep 3, 2021
d77fa59
remove more freeze tests
danhermann Sep 3, 2021
569ea20
spotless
danhermann Sep 3, 2021
c911822
checkstyle
danhermann Sep 3, 2021
34e1640
remove doc references to freezing indices
danhermann Sep 3, 2021
a401b4e
Merge branch 'master' into 70192_remove_freeze_endpoint
elasticmachine Sep 3, 2021
82ebbdc
more checkstyle
danhermann Sep 3, 2021
0203c4d
remove more doc references
danhermann Sep 3, 2021
4e02ea7
doc references
danhermann Sep 3, 2021
a24693c
fix doc build
danhermann Sep 3, 2021
7f42321
remove API spec
danhermann Sep 3, 2021
be8f480
Merge branch 'master' into 70192_remove_freeze_endpoint
elasticmachine Sep 6, 2021
f438c85
Merge branch '70192_remove_freeze_endpoint' of https://github.com/dan…
danhermann Sep 6, 2021
dbe9716
Merge branch 'master' into 70192_remove_freeze_endpoint
elasticmachine Sep 8, 2021
db50284
review comments
danhermann Sep 8, 2021
7745283
Add redirects to fix docs build
jrodewig Sep 8, 2021
51f524e
Merge branch 'master' into 70192_remove_freeze_endpoint
danhermann Sep 8, 2021
b7c15bf
Update docs/reference/indices/index-mgmt.asciidoc
danhermann Sep 8, 2021
5cf3c59
Update docs/reference/sql/language/indices.asciidoc
danhermann Sep 8, 2021
2592461
Update docs/reference/search/search-your-data/search-your-data.asciidoc
danhermann Sep 8, 2021
ca691a7
Update docs/reference/search/search-your-data/long-running-searches.a…
danhermann Sep 8, 2021
061908a
Fix docs build
jrodewig Sep 8, 2021
fe93302
review suggestions
danhermann Sep 8, 2021
137370f
Relocate deprecation admon
jrodewig Sep 8, 2021
3ab83b1
Merge remote-tracking branch 'upstream/master' into 70192_remove_free…
jrodewig Sep 8, 2021
91f8265
Merge branch 'master' into 70192_remove_freeze_endpoint
elasticmachine Sep 10, 2021
1bddf77
Merge branch 'master' into 70192_remove_freeze_endpoint
danhermann Sep 14, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import org.elasticsearch.action.support.WriteRequest;
import org.elasticsearch.action.support.broadcast.BroadcastResponse;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.client.core.ShardsAcknowledgedResponse;
import org.elasticsearch.client.indices.AnalyzeRequest;
import org.elasticsearch.client.indices.AnalyzeResponse;
import org.elasticsearch.client.indices.CloseIndexRequest;
Expand All @@ -58,7 +57,6 @@
import org.elasticsearch.client.indices.DeleteAliasRequest;
import org.elasticsearch.client.indices.DeleteComposableIndexTemplateRequest;
import org.elasticsearch.client.indices.DeleteDataStreamRequest;
import org.elasticsearch.client.indices.FreezeIndexRequest;
import org.elasticsearch.client.indices.GetComposableIndexTemplateRequest;
import org.elasticsearch.client.indices.GetComposableIndexTemplatesResponse;
import org.elasticsearch.client.indices.GetDataStreamRequest;
Expand All @@ -80,7 +78,6 @@
import org.elasticsearch.client.indices.ReloadAnalyzersResponse;
import org.elasticsearch.client.indices.SimulateIndexTemplateRequest;
import org.elasticsearch.client.indices.SimulateIndexTemplateResponse;
import org.elasticsearch.client.indices.UnfreezeIndexRequest;
import org.elasticsearch.client.indices.rollover.RolloverRequest;
import org.elasticsearch.client.indices.rollover.RolloverResponse;
import org.elasticsearch.cluster.metadata.AliasMetadata;
Expand All @@ -95,11 +92,11 @@
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.ByteSizeUnit;
import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.core.TimeValue;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.common.xcontent.json.JsonXContent;
import org.elasticsearch.common.xcontent.support.XContentMapValues;
import org.elasticsearch.core.TimeValue;
import org.elasticsearch.index.IndexSettings;
import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
Expand Down Expand Up @@ -1533,24 +1530,6 @@ public void testAnalyze() throws Exception {
assertNotNull(detailsResponse.detail());
}

public void testFreezeAndUnfreeze() throws IOException {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dakrone, one of consequences of removing the freeze endpoint is that many tests for unfreeze depend on it. Do you have any concerns about removing tests that exercise the unfreeze endpoint?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for these tests specifically, I think it's fine to change the client tests

createIndex("test", Settings.EMPTY);
RestHighLevelClient client = highLevelClient();

final RequestOptions freezeIndexOptions = RequestOptions.DEFAULT.toBuilder()
.setWarningsHandler(warnings -> List.of(FROZEN_INDICES_DEPRECATION_WARNING).equals(warnings) == false).build();

ShardsAcknowledgedResponse freeze = execute(new FreezeIndexRequest("test"), client.indices()::freeze,
client.indices()::freezeAsync, freezeIndexOptions);
assertTrue(freeze.isShardsAcknowledged());
assertTrue(freeze.isAcknowledged());

ShardsAcknowledgedResponse unfreeze = execute(new UnfreezeIndexRequest("test"), client.indices()::unfreeze,
client.indices()::unfreezeAsync, freezeIndexOptions);
assertTrue(unfreeze.isShardsAcknowledged());
assertTrue(unfreeze.isAcknowledged());
}

public void testReloadAnalyzer() throws IOException {
createIndex("test", Settings.EMPTY);
RestHighLevelClient client = highLevelClient();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,21 @@
import org.elasticsearch.client.indices.DeleteAliasRequest;
import org.elasticsearch.client.indices.DeleteComposableIndexTemplateRequest;
import org.elasticsearch.client.indices.DetailAnalyzeResponse;
import org.elasticsearch.client.indices.FreezeIndexRequest;
import org.elasticsearch.client.indices.GetComposableIndexTemplateRequest;
import org.elasticsearch.client.indices.GetComposableIndexTemplatesResponse;
import org.elasticsearch.client.indices.GetFieldMappingsRequest;
import org.elasticsearch.client.indices.GetFieldMappingsResponse;
import org.elasticsearch.client.indices.GetIndexRequest;
import org.elasticsearch.client.indices.GetIndexResponse;
import org.elasticsearch.client.indices.GetComposableIndexTemplateRequest;
import org.elasticsearch.client.indices.GetIndexTemplatesRequest;
import org.elasticsearch.client.indices.GetIndexTemplatesResponse;
import org.elasticsearch.client.indices.GetComposableIndexTemplatesResponse;
import org.elasticsearch.client.indices.GetMappingsRequest;
import org.elasticsearch.client.indices.GetMappingsResponse;
import org.elasticsearch.client.indices.IndexTemplateMetadata;
import org.elasticsearch.client.indices.IndexTemplatesExistRequest;
import org.elasticsearch.client.indices.PutComponentTemplateRequest;
import org.elasticsearch.client.indices.PutIndexTemplateRequest;
import org.elasticsearch.client.indices.PutComposableIndexTemplateRequest;
import org.elasticsearch.client.indices.PutIndexTemplateRequest;
import org.elasticsearch.client.indices.PutMappingRequest;
import org.elasticsearch.client.indices.ReloadAnalyzersRequest;
import org.elasticsearch.client.indices.ReloadAnalyzersResponse;
Expand All @@ -89,10 +88,10 @@
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.ByteSizeUnit;
import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.core.TimeValue;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.core.TimeValue;
import org.elasticsearch.index.IndexSettings;
import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
Expand Down Expand Up @@ -2859,87 +2858,6 @@ public void onFailure(Exception e) {

}

public void testFreezeIndex() throws Exception {
RestHighLevelClient client = highLevelClient();

{
CreateIndexResponse createIndexResponse = client.indices().create(new CreateIndexRequest("index"), RequestOptions.DEFAULT);
assertTrue(createIndexResponse.isAcknowledged());
}

{
// tag::freeze-index-request
FreezeIndexRequest request = new FreezeIndexRequest("index"); // <1>
// end::freeze-index-request

// tag::freeze-index-request-timeout
request.setTimeout(TimeValue.timeValueMinutes(2)); // <1>
// end::freeze-index-request-timeout
// tag::freeze-index-request-masterTimeout
request.setMasterTimeout(TimeValue.timeValueMinutes(1)); // <1>
// end::freeze-index-request-masterTimeout
// tag::freeze-index-request-waitForActiveShards
request.setWaitForActiveShards(ActiveShardCount.DEFAULT); // <1>
// end::freeze-index-request-waitForActiveShards

// tag::freeze-index-request-indicesOptions
request.setIndicesOptions(IndicesOptions.strictExpandOpen()); // <1>
// end::freeze-index-request-indicesOptions

final RequestOptions freezeIndexOptions = RequestOptions.DEFAULT.toBuilder()
.setWarningsHandler(warnings -> List.of(FROZEN_INDICES_DEPRECATION_WARNING).equals(warnings) == false).build();

// tag::freeze-index-execute
ShardsAcknowledgedResponse openIndexResponse = client.indices().freeze(request, freezeIndexOptions);
// end::freeze-index-execute

// tag::freeze-index-response
boolean acknowledged = openIndexResponse.isAcknowledged(); // <1>
boolean shardsAcked = openIndexResponse.isShardsAcknowledged(); // <2>
// end::freeze-index-response
assertTrue(acknowledged);
assertTrue(shardsAcked);

// tag::freeze-index-execute-listener
ActionListener<ShardsAcknowledgedResponse> listener =
new ActionListener<ShardsAcknowledgedResponse>() {
@Override
public void onResponse(ShardsAcknowledgedResponse freezeIndexResponse) {
// <1>
}

@Override
public void onFailure(Exception e) {
// <2>
}
};
// end::freeze-index-execute-listener

// Replace the empty listener by a blocking listener in test
final CountDownLatch latch = new CountDownLatch(1);
listener = new LatchedActionListener<>(listener, latch);

// tag::freeze-index-execute-async
client.indices().freezeAsync(request, RequestOptions.DEFAULT, listener); // <1>
// end::freeze-index-execute-async

assertTrue(latch.await(30L, TimeUnit.SECONDS));
}

{
// tag::freeze-index-notfound
try {
FreezeIndexRequest request = new FreezeIndexRequest("does_not_exist");
client.indices().freeze(request, RequestOptions.DEFAULT);
} catch (ElasticsearchException exception) {
if (exception.status() == RestStatus.BAD_REQUEST) {
// <1>
}
}
// end::freeze-index-notfound
}
}

public void testUnfreezeIndex() throws Exception {
RestHighLevelClient client = highLevelClient();

Expand Down
65 changes: 0 additions & 65 deletions docs/java-rest/high-level/indices/freeze_index.asciidoc

This file was deleted.

1 change: 0 additions & 1 deletion docs/java-rest/high-level/supported-apis.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ include::indices/validate_query.asciidoc[]
include::indices/get_templates.asciidoc[]
include::indices/templates_exist.asciidoc[]
include::indices/get_index.asciidoc[]
include::indices/freeze_index.asciidoc[]
include::indices/unfreeze_index.asciidoc[]
include::indices/delete_template.asciidoc[]
include::indices/reload_analyzers.asciidoc[]
Expand Down
8 changes: 8 additions & 0 deletions docs/java-rest/redirects.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,11 @@ See <<java-rest-high-start-transform>>.
=== Stop {transform} API

See <<java-rest-high-stop-transform>>.

[role="exclude",id="java-rest-high-freeze-index"]
=== Freeze index API

The freeze index API was removed in 8.0. Frozen indices are no longer useful due
to
https://www.elastic.co/blog/significantly-decrease-your-elasticsearch-heap-memory-usage[recent
improvements in heap memory usage].
1 change: 0 additions & 1 deletion docs/reference/data-streams/data-streams.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ such as:

* <<indices-clone-index,Clone>>
* <<indices-delete-index,Delete>>
* <<freeze-index-api,Freeze>>
* <<indices-shrink-index,Shrink>>
* <<indices-split-index,Split>>

Expand Down
34 changes: 0 additions & 34 deletions docs/reference/ilm/actions/ilm-freeze.asciidoc

This file was deleted.

3 changes: 1 addition & 2 deletions docs/reference/ilm/actions/ilm-searchable-snapshot.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ index>> to the frozen tier. In other phases, the action mounts a
<<fully-mounted,fully mounted index>> to the corresponding data tier.

IMPORTANT: If the `searchable_snapshot` action is used in the hot phase the
subsequent phases cannot include the `shrink`, `forcemerge`, or `freeze`
actions.
subsequent phases cannot include the `shrink` or `forcemerge` actions.

[NOTE]
This action cannot be performed on a data stream's write index. Attempts to do
Expand Down
4 changes: 0 additions & 4 deletions docs/reference/ilm/ilm-actions.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ Permanently remove the index.
Reduce the number of index segments and purge deleted documents.
Makes the index read-only.

<<ilm-freeze,Freeze>>::
Freeze the index to minimize its memory footprint.

<<ilm-migrate,Migrate>>::
Move the index shards to the <<data-tiers, data tier>> that corresponds
to the current {ilm-init} phase.
Expand Down Expand Up @@ -49,7 +46,6 @@ Ensure that a snapshot exists before deleting the index.
include::actions/ilm-allocate.asciidoc[]
include::actions/ilm-delete.asciidoc[]
include::actions/ilm-forcemerge.asciidoc[]
include::actions/ilm-freeze.asciidoc[]
include::actions/ilm-migrate.asciidoc[]
include::actions/ilm-readonly.asciidoc[]
include::actions/ilm-rollover.asciidoc[]
Expand Down
1 change: 0 additions & 1 deletion docs/reference/ilm/ilm-index-lifecycle.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ actions in the order listed.
- <<ilm-searchable-snapshot, Searchable Snapshot>>
- <<ilm-allocate,Allocate>>
- <<ilm-migrate,Migrate>>
- <<ilm-freeze,Freeze>>
* Frozen
- <<ilm-searchable-snapshot, Searchable Snapshot>>
* Delete
Expand Down
11 changes: 5 additions & 6 deletions docs/reference/ilm/ilm-overview.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<titleabbrev>Overview</titleabbrev>
++++

You can create and apply {ilm-cap} ({ilm-init}) policies to automatically manage your indices
according to your performance, resiliency, and retention requirements.
You can create and apply {ilm-cap} ({ilm-init}) policies to automatically manage your indices
according to your performance, resiliency, and retention requirements.

Index lifecycle policies can trigger actions such as:

Expand All @@ -17,7 +17,6 @@ size, number of docs, or age.
* **Shrink**: Reduces the number of primary shards in an index.
* **Force merge**: Triggers a <<indices-forcemerge,force merge>> to reduce the
number of segments in an index's shards.
* **Freeze**: <<freeze-index-api, Freezes>> an index and makes it read-only.
* **Delete**: Permanently remove an index, including all of its data and
metadata.

Expand Down Expand Up @@ -48,9 +47,9 @@ hardware.

[IMPORTANT]
===========================
To use {ilm-init}, all nodes in a cluster must run the same version.
Although it might be possible to create and apply policies in a mixed-version cluster,
To use {ilm-init}, all nodes in a cluster must run the same version.
Although it might be possible to create and apply policies in a mixed-version cluster,
there is no guarantee they will work as intended.
Attempting to use a policy that contains actions that aren't
supported on all nodes in a cluster will cause errors.
supported on all nodes in a cluster will cause errors.
===========================
Loading