Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent downgrades from 8.x to 7.x #78638

Conversation

DaveCTurner
Copy link
Contributor

Users sometimes attempt to downgrade a node in place, but downgrades are
totally untested and unsupported and generally don't work. We protect
against this by recording the node version in the metadata and refusing
to start if we encounter metadata written by a future version.

However in 8.0 (#42489) we changed the directory layout so that a 7.x
node won't find the upgraded metadata, or indeed any other data, and
will proceed as if it's a fresh node. That's almost certainly not what
the user wants, so with this commit we create a file at
${path.data}/nodes at each startup, preventing an older node from
starting.

Closes #52414

Users sometimes attempt to downgrade a node in place, but downgrades are
totally untested and unsupported and generally don't work. We protect
against this by recording the node version in the metadata and refusing
to start if we encounter metadata written by a future version.

However in 8.0 (elastic#42489) we changed the directory layout so that a 7.x
node won't find the upgraded metadata, or indeed any other data, and
will proceed as if it's a fresh node. That's almost certainly not what
the user wants, so with this commit we create a file at
`${path.data}/nodes` at each startup, preventing an older node from
starting.

Closes elastic#52414
@DaveCTurner DaveCTurner added >enhancement :Distributed Coordination/Cluster Coordination Cluster formation and cluster state publication, including cluster membership and fault detection. v8.0.0 labels Oct 4, 2021
@elasticmachine elasticmachine added the Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. label Oct 4, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

@DaveCTurner
Copy link
Contributor Author

This is just a retread of #78586 which was merged prematurely and then reverted. See #78586 for reviews.

DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Oct 4, 2021
In elastic#78638 we introduced a simple mechanism for blocking downgrades from
8.x to 7.x, but the exception message it generates is not very helpful:

    org.elasticsearch.bootstrap.StartupException: ElasticsearchException[failed to bind service]; nested: FileSystemException[{path.data}/nodes/0: Not a directory];

We can't fix earlier 7.x versions to do something better, but this
commit at least means that sufficiently recent 7.x versions will yield a
slightly more helpful message.
DaveCTurner added a commit that referenced this pull request Oct 7, 2021
In #78638 we introduced a simple mechanism for blocking downgrades from
8.x to 7.x, but the exception message it generates is not very helpful:

    org.elasticsearch.bootstrap.StartupException: ElasticsearchException[failed to bind service]; nested: FileSystemException[{path.data}/nodes/0: Not a directory];

We can't fix earlier 7.x versions to do something better, but this
commit at least means that sufficiently recent 7.x versions will yield a
slightly more helpful message.
@DaveCTurner DaveCTurner added the auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Oct 14, 2021
@DaveCTurner
Copy link
Contributor Author

I think this will no longer conflict with #78525 so I'll merge it after a green CI run.

@elasticsearchmachine elasticsearchmachine merged commit edb29e0 into elastic:master Oct 14, 2021
@DaveCTurner DaveCTurner deleted the 2021-10-04-prevent-downgrade-to-7x-redux branch October 14, 2021 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) :Distributed Coordination/Cluster Coordination Cluster formation and cluster state publication, including cluster membership and fault detection. >enhancement Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. v8.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New directory layout does not play nicely with upgrades/downgrades
4 participants