HDDS-14754. Add ZDU upgrade action to clean up leftover state - #10889
HDDS-14754. Add ZDU upgrade action to clean up leftover state#10889errose28 wants to merge 5 commits into
Conversation
| if (!marker.delete()) { | ||
| throw new IOException("Failed to delete leftover OM prepare marker file " + marker); | ||
| } |
There was a problem hiding this comment.
I believe this is really unlikely to happen, but this is different from SCM, to throw this exception. If this happens the marker file deletion won't happen until finalization called again? Will the finalization fail?
There was a problem hiding this comment.
Ideally OM and SCM should crash if there is an error during finalization. We can't have the ratis group in a mixed finalization state. The existing tests only check that an exception is propagated out of the version manager, but it looks like neither component will actually crash. I'll add this to the PR.
There was a problem hiding this comment.
It turns out OM and SCM were crashing if upgrade actions failed, because an UpgradeException is mapped to an INTERNAL_ERROR result code which will crash each service. I added tests for this, although they look different due to the differences in how Ratis requests are processed on each service.
DNs are expected to keep retrying finalization as instructed by SCM, since they do not need to match with a quorum.
There was a problem hiding this comment.
I also added and tested that failure to load an upgrade action will throw an unchecked exception. Previously it was just logging an error which could result in a misconfigured upgrade action not running.
|
The CI failure is newly added test, otherwise the latest change make sense, once the test is sorted out |
|
I had wrapped the |
dombizita
left a comment
There was a problem hiding this comment.
Thanks for updating, sounds good!
What changes were proposed in this pull request?
OM Prepare for upgrade will be a no-op once ZDU is supported. There may be leftover state in the DB and VERSION file indicating that the OM was put in prepare mode in the prior version. We should remove this state in an upgrade action tied to OM version 100 (ZDU support) which will run when the OM is finalized. Similarly, SCM will no longer have a finalization-in-progress marker in its DB. This should be completely cleared out by the old version when SCM finishes finalizing, but we can also add an upgrade action to ensure it is removed.
What is the link to the Apache JIRA
HDDS-14754
How was this patch tested?
Unit tests for the upgrade actions were added, but they are difficult to test in a real cluster during the upgrade.
The existing mock upgrade actions for ZDU that were used in testing have been removed since we have concrete actions to test with now.