-
Notifications
You must be signed in to change notification settings - Fork 9.2k
HDFS-17396. BootstrapStandby should download rollback image during RollingUpgrade #6583
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
Conversation
| int nnIdx, List<Integer> txids) { | ||
|
|
||
| for (File nameDir : getNameNodeCurrentDirs(cluster, nnIdx)) { | ||
| LOG.info("examining name dir with files: " + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use the logger format?
...roject/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/FSImageTestUtil.java
Show resolved
Hide resolved
|
|
||
| for (int i = 1; i < maxNNCount; i++) { | ||
| assertTrue("NameNodes should all have the rollback FSImage", | ||
| cluster.getNameNode(i).getFSImage().hasRollbackFSImage()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Easier to read if you extract the nn = cluster.getNameNode(i);
| // Start rolling upgrade | ||
| fs.rollingUpgrade(RollingUpgradeAction.PREPARE); | ||
| RollingUpgradeInfo info = fs.rollingUpgrade(RollingUpgradeAction.QUERY); | ||
| while (!info.createdRollbackImages()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unbounded. Can you use LambdaTestUtils#wait or similar?
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
Description of PR
Due to HDFS-17178, BootstrapStandby can now succeed during a RollingUpgrade. This can lead to an edge case where the bootstrapped NameNode does not have the fsimage_rollback_N file locally so it does not recognize that it is in a RollingUpgrade. This means the bootstrapped NameNode will overwrite the VERSION file during a checkpoint because it does not know that the NameService is in a RollingUpgrade.
BootstrapStandby needs to download the fsimage_rollback_N file in addition to the normal fsimage_N file so that the bootstrapped node correctly recognizes the RollingUpgrade state of the NameService.
How was this patch tested?
Added unit tests to cover the scenario and verify the rollback image is downloaded.
For code changes:
LICENSE,LICENSE-binary,NOTICE-binaryfiles?