Repository navigation
Conversation
…restarts pre-finalized and shuts down every finalized datanode
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
Static review found no blocking issues in the bounded recovery logic, startup placement, or regression coverage; tests were not executed.
No open issues 🎉
What changed in this PR
This PR fixes SCM startup recovery after an interrupted Raft snapshot installation leaves the DB ahead of the VERSION file, preventing SCM from incorrectly rejecting finalized datanodes.
Changes:
- Reconciles SCM’s apparent version with the DB during startup.
- Adds bounded finalization so recovery stops at the DB version rather than the software version.
- Adds regression coverage for version mismatches and documents startup-time upgrade actions.
| File | Description |
|---|---|
| hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/upgrade/TestScmStartupInvalidApparentVersion.java | Tests recovery when the DB version is ahead and preserves behavior when it is behind. |
| hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/upgrade/ScmUpgradeAction.java | Documents that upgrade actions can run during SCM construction. |
| hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/StorageContainerManager.java | Invokes DB-version reconciliation during startup. |
| hadoop-hdds/framework/src/main/java/org/apache/hadoop/ozone/upgrade/RatisBasedVersionManager.java | Adds recovery to the apparent version recorded in the DB. |
| hadoop-hdds/framework/src/main/java/org/apache/hadoop/ozone/upgrade/ComponentVersionManager.java | Allows finalization up to a specified version. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
When a follower SCM installs a Raft snapshot, the DB is replaced atomically in step 1, then the VERSION file is written in step 2. A crash between those two steps leaves:
The Raft log replay cannot recover this because finalization happened before the checkpoint index. On the next start, the SCM's versionManager reads only the VERSION file, believes it is pre-finalized, and then its datanode server rejects every datanode that was actually finalized — causing a cluster outage.
This issue was found and the fix generated by AI.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-17089
How was this patch tested?
New unit test to prove the issue is resolved.