mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-07 13:38:49 +00:00
399f0ccce9
This option defaults to false, because it is also important to upgrade the "merely old" segments since many Lucene improvements happen within minor releases. But you can pass true to do the minimal work necessary to upgrade to the next major Elasticsearch release. The HTTP GET upgrade request now also breaks out how many bytes of ancient segments need upgrading. Closes #10213 Closes #10540 Conflicts: dev-tools/create_bwc_index.py rest-api-spec/api/indices.upgrade.json src/main/java/org/elasticsearch/action/admin/indices/optimize/OptimizeRequest.java src/main/java/org/elasticsearch/action/admin/indices/optimize/ShardOptimizeRequest.java src/main/java/org/elasticsearch/action/admin/indices/optimize/TransportOptimizeAction.java src/main/java/org/elasticsearch/index/engine/InternalEngine.java src/test/java/org/elasticsearch/bwcompat/StaticIndexBackwardCompatibilityTest.java src/test/java/org/elasticsearch/index/engine/InternalEngineTests.java src/test/java/org/elasticsearch/rest/action/admin/indices/upgrade/UpgradeReallyOldIndexTest.java
67 lines
2.2 KiB
Plaintext
67 lines
2.2 KiB
Plaintext
[[indices-upgrade]]
|
|
== Upgrade
|
|
|
|
The upgrade API allows to upgrade one or more indices to the latest format
|
|
through an API. The upgrade process converts any segments written
|
|
with previous formats.
|
|
|
|
[float]
|
|
=== Start an upgrade
|
|
|
|
[source,sh]
|
|
--------------------------------------------------
|
|
$ curl -XPOST 'http://localhost:9200/twitter/_upgrade'
|
|
--------------------------------------------------
|
|
|
|
NOTE: Upgrading is an I/O intensive operation, and is limited to processing a
|
|
single shard per node at a time. It also is not allowed to run at the same
|
|
time as optimize.
|
|
|
|
This call will block until the upgrade is complete. If the http connection
|
|
is lost, the request will continue in the background, and
|
|
any new requests will block until the previous upgrade is complete.
|
|
|
|
[float]
|
|
[[upgrade-parameters]]
|
|
==== Request Parameters
|
|
|
|
The `upgrade` API accepts the following request parameters:
|
|
|
|
[horizontal]
|
|
`only_ancient_segments`:: If true, only very old segments (from a
|
|
previous Lucene major release) will be upgraded. While this will do
|
|
the minimal work to ensure the next major release of Elasticsearch can
|
|
read the segments, it's dangerous because it can leave other very old
|
|
segments in sub-optimal formats. Defaults to `false`.
|
|
|
|
[float]
|
|
=== Check upgrade status
|
|
|
|
Use a `GET` request to monitor how much of an index is upgraded. This
|
|
can also be used prior to starting an upgrade to identify which
|
|
indices you want to upgrade at the same time.
|
|
|
|
The `ancient` byte values that are returned indicate total bytes of
|
|
segments whose version is extremely old (Lucene major version is
|
|
different from the current version), showing how much upgrading is
|
|
necessary when you run with `only_ancient_segments=true`.
|
|
|
|
[source,sh]
|
|
--------------------------------------------------
|
|
curl 'http://localhost:9200/twitter/_upgrade?pretty&human'
|
|
--------------------------------------------------
|
|
|
|
[source,js]
|
|
--------------------------------------------------
|
|
{
|
|
"twitter": {
|
|
"size": "21gb",
|
|
"size_in_bytes": "21000000000",
|
|
"size_to_upgrade": "10gb",
|
|
"size_to_upgrade_in_bytes": "10000000000"
|
|
"size_to_upgrade_ancient": "1gb",
|
|
"size_to_upgrade_ancient_in_bytes": "1000000000"
|
|
}
|
|
}
|
|
--------------------------------------------------
|