From c637fea84b7b52e60edd851547a2ad88897501f7 Mon Sep 17 00:00:00 2001 From: Lee Hinman Date: Tue, 7 Jun 2016 15:06:20 -0600 Subject: [PATCH] Change the default of `include_global_state` from true to false for restores This changes the default value to be false *only* for restore operations. Resolves #18569 --- .../restore/RestoreSnapshotRequest.java | 2 +- .../migration/migrate_5_0/settings.asciidoc | 6 ++++ docs/reference/modules/snapshots.asciidoc | 33 +++++++++++-------- 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequest.java b/core/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequest.java index bf4e4f148fc..1a41a776c73 100644 --- a/core/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequest.java +++ b/core/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequest.java @@ -57,7 +57,7 @@ public class RestoreSnapshotRequest extends MasterNodeRequest>. The `rename_pattern` and `rename_replacement` options can be also used to -rename index on restore using regular expression that supports referencing the original text as explained +By default, all indices in the snapshot are restored, and the cluster state is +*not* restored. It's possible to select indices that should be restored as well +as to allow the global cluster state from being restored by using `indices` and +`include_global_state` options in the restore request body. The list of indices +supports <>. The `rename_pattern` +and `rename_replacement` options can be also used to rename index on restore +using regular expression that supports referencing the original text as +explained http://docs.oracle.com/javase/6/docs/api/java/util/regex/Matcher.html#appendReplacement(java.lang.StringBuffer,%20java.lang.String)[here]. -Set `include_aliases` to `false` to prevent aliases from being restored together with associated indices +Set `include_aliases` to `false` to prevent aliases from being restored together +with associated indices [source,js] ----------------------------------- @@ -337,19 +341,22 @@ POST /_snapshot/my_backup/snapshot_1/_restore { "indices": "index_1,index_2", "ignore_unavailable": "true", - "include_global_state": false, + "include_global_state": true, "rename_pattern": "index_(.+)", "rename_replacement": "restored_index_$1" } ----------------------------------- // CONSOLE -The restore operation can be performed on a functioning cluster. However, an existing index can be only restored if it's -<> and has the same number of shards as the index in the snapshot. -The restore operation automatically opens restored indices if they were closed and creates new indices if they -didn't exist in the cluster. If cluster state is restored, the restored templates that don't currently exist in the -cluster are added and existing templates with the same name are replaced by the restored templates. The restored -persistent settings are added to the existing persistent settings. +The restore operation can be performed on a functioning cluster. However, an +existing index can be only restored if it's <> and +has the same number of shards as the index in the snapshot. The restore +operation automatically opens restored indices if they were closed and creates +new indices if they didn't exist in the cluster. If cluster state is restored +with `include_cluster_state` (defaults to `false`), the restored templates that +don't currently exist in the cluster are added and existing templates with the +same name are replaced by the restored templates. The restored persistent +settings are added to the existing persistent settings. [float] ==== Partial restore