Skip to content

Discrepancy between 5.x documentation and actual behaviour on global state restore #26453

@nachogiljaldo

Description

@nachogiljaldo

Elasticsearch version (bin/elasticsearch --version): 5.4.1

Plugins installed: []

JVM version (java -version): 1.8.0_131

OS version (uname -a if on a Unix-like system): Linux d14085ba52c1 4.4.0-66-generic #87~14.04.1-Ubuntu SMP Fri Mar 3 17:32:36 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Description of the problem including expected versus actual behavior:
On version 5.4.1, when I try to restore a snapshot taken in a cluster with minimum_master_nodes: 2 in a cluster with one instance only and include_global_state: true, the restore endpoint returns a 500 state and the response:

{"error":{"root_cause":[{"type":"snapshot_restore_exception","reason":"[found-snapshots:scheduled-1504176332-instance-0000000002/eC4eaXFFRr2cE41gp4tQYQ] cannot restore index [.security] because it's open"}],"type":"snapshot_restore_exception","reason":"[found-snapshots:scheduled-1504176332-instance-0000000002/eC4eaXFFRr2cE41gp4tQYQ] cannot restore index [.security] because it's open"},"status":500}

However, according to the documentation, I would expect it to work and it actually does on 2.4.6.
Should the documentation be fixed? Should the behaviour be fixed to match the docs and previous versions?

Steps to reproduce:

  1. create a cluster with 3 nodes and set minimum_master_nodes to 2
  2. create a snapshot
  3. try to restore that cluster to a 1 instance cluster with include_global_state true
  4. the restore endpoint should return a 500

Provide logs (if relevant):
Version 5.4.1:

[2017-08-31T10:49:33,579][WARN ][org.elasticsearch.snapshots.RestoreService] [scheduled-1504176332-instance-0000000002/eC4eaXFFRr2cE41gp4tQYQ] failed to restore snapshot
java.lang.IllegalArgumentException: illegal value can't update [discovery.zen.minimum_master_nodes] from [1] to [2]
	at org.elasticsearch.common.settings.Setting$Updater.getValue(Setting.java:610) ~[elasticsearch-5.4.1.jar:5.4.1]
	at org.elasticsearch.common.settings.AbstractScopedSettings.validateUpdate(AbstractScopedSettings.java:135) ~[elasticsearch-5.4.1.jar:5.4.1]
	at org.elasticsearch.snapshots.RestoreService$1.restoreGlobalStateIfRequested(RestoreService.java:458) ~[elasticsearch-5.4.1.jar:5.4.1]
	at org.elasticsearch.snapshots.RestoreService$1.execute(RestoreService.java:347) ~[elasticsearch-5.4.1.jar:5.4.1]
	at org.elasticsearch.cluster.ClusterStateUpdateTask.execute(ClusterStateUpdateTask.java:45) ~[elasticsearch-5.4.1.jar:5.4.1]
	at org.elasticsearch.cluster.service.ClusterService.executeTasks(ClusterService.java:633) ~[elasticsearch-5.4.1.jar:5.4.1]
	at org.elasticsearch.cluster.service.ClusterService.calculateTaskOutputs(ClusterService.java:611) ~[elasticsearch-5.4.1.jar:5.4.1]
	at org.elasticsearch.cluster.service.ClusterService.runTasks(ClusterService.java:570) [elasticsearch-5.4.1.jar:5.4.1]
	at org.elasticsearch.cluster.service.ClusterService$ClusterServiceTaskBatcher.run(ClusterService.java:262) [elasticsearch-5.4.1.jar:5.4.1]
	at org.elasticsearch.cluster.service.TaskBatcher.runIfNotProcessed(TaskBatcher.java:150) [elasticsearch-5.4.1.jar:5.4.1]
	at org.elasticsearch.cluster.service.TaskBatcher$BatchedTask.run(TaskBatcher.java:188) [elasticsearch-5.4.1.jar:5.4.1]
	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:569) [elasticsearch-5.4.1.jar:5.4.1]
	at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:247) [elasticsearch-5.4.1.jar:5.4.1]
	at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:210) [elasticsearch-5.4.1.jar:5.4.1]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_131]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_131]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]
Caused by: java.lang.IllegalArgumentException: cannot set discovery.zen.minimum_master_nodes to more than the current master nodes count [1]
	at org.elasticsearch.discovery.zen.ZenDiscovery.lambda$new$2(ZenDiscovery.java:187) ~[elasticsearch-5.4.1.jar:5.4.1]
	at org.elasticsearch.common.settings.Setting$Updater.getValue(Setting.java:608) ~[elasticsearch-5.4.1.jar:5.4.1]
	... 16 more

Related PRs

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions