Skip to content

Commit

Permalink
SNAPSHOT: Restore Should Check Min. Version
Browse files Browse the repository at this point in the history
* Restore should check minimum version in the cluster and not
the current master node's version for compatibility
* Closes elastic#34264
  • Loading branch information
original-brownbear committed Oct 21, 2018
1 parent 222652d commit da3e88d
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -790,10 +790,11 @@ private void validateSnapshotRestorable(final String repository, final SnapshotI
throw new SnapshotRestoreException(new Snapshot(repository, snapshotInfo.snapshotId()),
"unsupported snapshot state [" + snapshotInfo.state() + "]");
}
if (Version.CURRENT.before(snapshotInfo.version())) {
Version minVersion = clusterService.state().getNodes().getMinNodeVersion();
if (minVersion.before(snapshotInfo.version())) {
throw new SnapshotRestoreException(new Snapshot(repository, snapshotInfo.snapshotId()),
"the snapshot was created with Elasticsearch version [" + snapshotInfo.version() +
"] which is higher than the version of this node [" + Version.CURRENT + "]");
"] which is higher than the version of this cluster [" + minVersion + "]");
}
}

Expand Down

0 comments on commit da3e88d

Please sign in to comment.