Remove unfreeze REST endpoint (#119227)
This adds a sentence to `redirects.asciidoc` explaining what frozen indices were - otherwise, everything will point to the message about the unfreeze API having gone away, which is not very helpful. Some cross-references are updated to point to this rather than to the notice about the removal of the unfreeze API. ES-9736 #comment Removed `_unfreeze` REST endpoint in https://github.com/elastic/elasticsearch/pull/119227
This commit is contained in:
parent
d953079380
commit
d85b90ad8c
|
@ -0,0 +1,13 @@
|
|||
pr: 119227
|
||||
summary: Remove unfreeze REST endpoint
|
||||
area: Indices APIs
|
||||
type: breaking
|
||||
issues: []
|
||||
breaking:
|
||||
title: Remove unfreeze REST endpoint
|
||||
area: REST API
|
||||
details: >-
|
||||
The `/{index}/_unfreeze` REST endpoint is no longer supported. This API was deprecated, and the corresponding
|
||||
`/{index}/_freeze` endpoint was removed in 8.0.
|
||||
impact: None, since it is not possible to have a frozen index in a version which is readable by Elasticsearch 9.0
|
||||
notable: false
|
|
@ -24,7 +24,6 @@ index settings, aliases, mappings, and index templates.
|
|||
* <<indices-split-index>>
|
||||
* <<indices-clone-index>>
|
||||
* <<indices-rollover-index>>
|
||||
* <<unfreeze-index-api>>
|
||||
* <<indices-resolve-index-api>>
|
||||
* <<indices-resolve-cluster-api>>
|
||||
* <<indices-downsample-data-stream>>
|
||||
|
@ -143,6 +142,5 @@ include::indices/shrink-index.asciidoc[]
|
|||
include::indices/simulate-index.asciidoc[]
|
||||
include::indices/simulate-template.asciidoc[]
|
||||
include::indices/split-index.asciidoc[]
|
||||
include::indices/apis/unfreeze.asciidoc[]
|
||||
include::indices/update-settings.asciidoc[]
|
||||
include::indices/put-mapping.asciidoc[]
|
||||
|
|
|
@ -1,61 +0,0 @@
|
|||
[role="xpack"]
|
||||
[[unfreeze-index-api]]
|
||||
=== Unfreeze index API
|
||||
++++
|
||||
<titleabbrev>Unfreeze index</titleabbrev>
|
||||
++++
|
||||
|
||||
[WARNING]
|
||||
.Deprecated in 7.14
|
||||
====
|
||||
In 8.0, we removed the ability to freeze an index. In previous versions,
|
||||
freezing an index reduced its memory overhead. However, 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].
|
||||
You can use this API to unfreeze indices that were frozen in 7.x. Frozen indices
|
||||
are not related to the frozen data tier.
|
||||
====
|
||||
|
||||
.New API reference
|
||||
[sidebar]
|
||||
--
|
||||
For the most up-to-date API details, refer to {api-es}/group/endpoint-indices[Index APIs].
|
||||
--
|
||||
|
||||
Unfreezes an index.
|
||||
|
||||
[[unfreeze-index-api-request]]
|
||||
==== {api-request-title}
|
||||
|
||||
`POST /<index>/_unfreeze`
|
||||
|
||||
[[unfreeze-index-api-prereqs]]
|
||||
==== {api-prereq-title}
|
||||
|
||||
* If the {es} {security-features} are enabled, you must have the `manage`
|
||||
<<privileges-list-indices,index privilege>> for the target index or index alias.
|
||||
|
||||
[[unfreeze-index-api-desc]]
|
||||
==== {api-description-title}
|
||||
|
||||
When a frozen index is unfrozen, the index goes through the normal recovery
|
||||
process and becomes writeable again.
|
||||
|
||||
[[unfreeze-index-api-path-parms]]
|
||||
==== {api-path-parms-title}
|
||||
|
||||
`<index>`::
|
||||
(Required, string) Identifier for the index.
|
||||
|
||||
[[unfreeze-index-api-examples]]
|
||||
==== {api-examples-title}
|
||||
|
||||
The following example unfreezes an index:
|
||||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
POST /my-index-000001/_unfreeze
|
||||
--------------------------------------------------
|
||||
// TEST[s/^/PUT my-index-000001\n/]
|
||||
// TEST[skip:unable to ignore deprecation warning]
|
|
@ -43,7 +43,7 @@ For more information on managing indices, refer to <<indices, Index APIs>>.
|
|||
|
||||
* To filter the list of indices, use the search bar or click a badge.
|
||||
Badges indicate if an index is a <<ccr-put-follow,follower index>>, a
|
||||
<<rollup-get-rollup-index-caps,rollup index>>, or <<unfreeze-index-api,frozen>>.
|
||||
<<rollup-get-rollup-index-caps,rollup index>>, or <<frozen-indices,frozen>>.
|
||||
|
||||
* To drill down into the index
|
||||
<<mapping,mappings>>, <<index-modules-settings,settings>>, and statistics,
|
||||
|
|
|
@ -156,10 +156,16 @@ See <<restore-entire-cluster>>.
|
|||
The freeze index API was removed in 8.0.
|
||||
// tag::frozen-removal-explanation[]
|
||||
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].
|
||||
https://www.elastic.co/blog/significantly-decrease-your-elasticsearch-heap-memory-usage[improvements
|
||||
in heap memory usage].
|
||||
// end::frozen-removal-explanation[]
|
||||
|
||||
[role="exclude",id="unfreeze-index-api"]
|
||||
=== Unfreeze index API
|
||||
|
||||
The unfreeze index API was removed in 9.0.
|
||||
include::redirects.asciidoc[tag=frozen-removal-explanation]
|
||||
|
||||
[role="exclude",id="ilm-freeze"]
|
||||
=== Freeze {ilm-init} action
|
||||
|
||||
|
@ -1749,8 +1755,10 @@ See <<search-terms-enum>>.
|
|||
=== Frozen indices
|
||||
|
||||
// tag::frozen-index-redirect[]
|
||||
|
||||
For API documentation, see <<unfreeze-index-api>>.
|
||||
Older versions of {es} provided the option to reduce the amount of data kept in memory for an index, at the expense of
|
||||
increasing search latency. This was known as 'freezing' the index.
|
||||
include::redirects.asciidoc[tag=frozen-removal-explanation]
|
||||
The freeze index API was removed in 8.0, and the unfreeze index API was removed in 9.0.
|
||||
// end::frozen-index-redirect[]
|
||||
|
||||
[role="exclude",id="best_practices"]
|
||||
|
|
|
@ -100,7 +100,7 @@ requires the keyword `LIKE` for SQL `LIKE` pattern.
|
|||
[[sql-index-frozen]]
|
||||
=== Frozen Indices
|
||||
|
||||
By default, {es-sql} doesn't search <<unfreeze-index-api,frozen indices>>. To
|
||||
By default, {es-sql} doesn't search <<frozen-indices,frozen indices>>. To
|
||||
search frozen indices, use one of the following features:
|
||||
|
||||
dedicated configuration parameter::
|
||||
|
|
|
@ -1,67 +0,0 @@
|
|||
{
|
||||
"indices.unfreeze":{
|
||||
"documentation":{
|
||||
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/unfreeze-index-api.html",
|
||||
"description":"Unfreezes an index. When a frozen index is unfrozen, the index goes through the normal recovery process and becomes writeable again."
|
||||
},
|
||||
"stability":"stable",
|
||||
"visibility":"public",
|
||||
"headers":{
|
||||
"accept": [ "application/json"]
|
||||
},
|
||||
"url":{
|
||||
"paths":[
|
||||
{
|
||||
"path":"/{index}/_unfreeze",
|
||||
"methods":[
|
||||
"POST"
|
||||
],
|
||||
"parts":{
|
||||
"index":{
|
||||
"type":"string",
|
||||
"description":"The name of the index to unfreeze"
|
||||
}
|
||||
},
|
||||
"deprecated":{
|
||||
"version":"7.14.0",
|
||||
"description":"Frozen indices are deprecated because they provide no benefit given improvements in heap memory utilization. They will be removed in a future release."
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"params":{
|
||||
"timeout":{
|
||||
"type":"time",
|
||||
"description":"Explicit operation timeout"
|
||||
},
|
||||
"master_timeout":{
|
||||
"type":"time",
|
||||
"description":"Specify timeout for connection to master"
|
||||
},
|
||||
"ignore_unavailable":{
|
||||
"type":"boolean",
|
||||
"description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)"
|
||||
},
|
||||
"allow_no_indices":{
|
||||
"type":"boolean",
|
||||
"description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"
|
||||
},
|
||||
"expand_wildcards":{
|
||||
"type":"enum",
|
||||
"options":[
|
||||
"open",
|
||||
"closed",
|
||||
"hidden",
|
||||
"none",
|
||||
"all"
|
||||
],
|
||||
"default":"closed",
|
||||
"description":"Whether to expand wildcard expression to concrete indices that are open, closed or both."
|
||||
},
|
||||
"wait_for_active_shards":{
|
||||
"type":"string",
|
||||
"description":"Sets the number of active shards to wait for before the operation returns."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -8,36 +8,22 @@ package org.elasticsearch.xpack.frozen;
|
|||
|
||||
import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionResponse;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
import org.elasticsearch.common.settings.IndexScopedSettings;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.settings.SettingsFilter;
|
||||
import org.elasticsearch.features.NodeFeature;
|
||||
import org.elasticsearch.index.IndexSettings;
|
||||
import org.elasticsearch.index.engine.EngineFactory;
|
||||
import org.elasticsearch.index.engine.frozen.FrozenEngine;
|
||||
import org.elasticsearch.plugins.ActionPlugin;
|
||||
import org.elasticsearch.plugins.EnginePlugin;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestHandler;
|
||||
import org.elasticsearch.xpack.core.action.XPackInfoFeatureAction;
|
||||
import org.elasticsearch.xpack.core.action.XPackUsageFeatureAction;
|
||||
import org.elasticsearch.xpack.core.frozen.action.FreezeIndexAction;
|
||||
import org.elasticsearch.xpack.frozen.action.TransportFreezeIndexAction;
|
||||
import org.elasticsearch.xpack.frozen.rest.action.RestFreezeIndexAction;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class FrozenIndices extends Plugin implements ActionPlugin, EnginePlugin {
|
||||
|
||||
|
@ -63,19 +49,4 @@ public class FrozenIndices extends Plugin implements ActionPlugin, EnginePlugin
|
|||
actions.add(new ActionHandler<>(FreezeIndexAction.INSTANCE, TransportFreezeIndexAction.class));
|
||||
return actions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RestHandler> getRestHandlers(
|
||||
Settings settings,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
RestController restController,
|
||||
ClusterSettings clusterSettings,
|
||||
IndexScopedSettings indexScopedSettings,
|
||||
SettingsFilter settingsFilter,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Supplier<DiscoveryNodes> nodesInCluster,
|
||||
Predicate<NodeFeature> clusterSupportsFeature
|
||||
) {
|
||||
return Collections.singletonList(new RestFreezeIndexAction());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,67 +0,0 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
package org.elasticsearch.xpack.frozen.rest.action;
|
||||
|
||||
import org.elasticsearch.action.support.ActiveShardCount;
|
||||
import org.elasticsearch.action.support.IndicesOptions;
|
||||
import org.elasticsearch.client.internal.node.NodeClient;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.core.UpdateForV9;
|
||||
import org.elasticsearch.protocol.xpack.frozen.FreezeRequest;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
import org.elasticsearch.rest.action.RestToXContentListener;
|
||||
import org.elasticsearch.xpack.core.frozen.action.FreezeIndexAction;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
import static org.elasticsearch.rest.RestUtils.getAckTimeout;
|
||||
import static org.elasticsearch.rest.RestUtils.getMasterNodeTimeout;
|
||||
|
||||
public final class RestFreezeIndexAction extends BaseRestHandler {
|
||||
|
||||
private static final String FREEZE_REMOVED = "It is no longer possible to freeze indices, but existing frozen indices can still be "
|
||||
+ "unfrozen";
|
||||
|
||||
private static final String UNFREEZE_DEPRECATED = "Frozen indices are deprecated because they provide no benefit given improvements "
|
||||
+ "in heap memory utilization. They will be removed in a future release.";
|
||||
|
||||
@UpdateForV9(owner = UpdateForV9.Owner.DISTRIBUTED_INDEXING)
|
||||
// these routes were ".deprecated" in RestApiVersion.V_8 which will require use of REST API compatibility headers to access
|
||||
// this API in v9. It is unclear if this was intentional for v9, and the code has been updated to ".deprecateAndKeep" which will
|
||||
// continue to emit deprecations warnings but will not require any special headers to access the API in v9.
|
||||
// Please review and update the code and tests as needed. The original code remains commented out below for reference.
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return List.of(
|
||||
// Route.builder(POST, "/{index}/_unfreeze").deprecated(UNFREEZE_DEPRECATED, RestApiVersion.V_8).build()
|
||||
Route.builder(POST, "/{index}/_unfreeze").deprecateAndKeep(UNFREEZE_DEPRECATED).build()
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) {
|
||||
final var freezeRequest = new FreezeRequest(
|
||||
getMasterNodeTimeout(request),
|
||||
getAckTimeout(request),
|
||||
Strings.splitStringByCommaToArray(request.param("index"))
|
||||
);
|
||||
freezeRequest.indicesOptions(IndicesOptions.fromRequest(request, freezeRequest.indicesOptions()));
|
||||
String waitForActiveShards = request.param("wait_for_active_shards");
|
||||
if (waitForActiveShards != null) {
|
||||
freezeRequest.waitForActiveShards(ActiveShardCount.parseString(waitForActiveShards));
|
||||
}
|
||||
freezeRequest.setFreeze(false);
|
||||
return channel -> client.execute(FreezeIndexAction.INSTANCE, freezeRequest, new RestToXContentListener<>(channel));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "freeze_index";
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue