HDDS-14646. SCM should not close Ratis pipelines on Finalize#9779
HDDS-14646. SCM should not close Ratis pipelines on Finalize#9779sodonnel wants to merge 12 commits intoapache:HDDS-14496-zdufrom
Conversation
c8172b8 to
fe8fff6
Compare
| "datanodes have finalized ({} remaining).", | ||
| finalizedNodes, totalHealthyNodes, unfinalizedNodes); | ||
| try { | ||
| Thread.sleep(5000); |
| if (!allDatanodesFinalized) { | ||
| LOG.info("Waiting for datanodes to finalize. Status: {}/{} healthy " + | ||
| "datanodes have finalized ({} remaining).", | ||
| finalizedNodes, totalHealthyNodes, unfinalizedNodes); |
There was a problem hiding this comment.
its would be nice to have a ids for unhealthy nodes and unfinalizedNodes. Also it would be nice to have a time in wait state.
… all finalize before finalization is complete
9acf575 to
9f6bac6
Compare
|
The Integration tests seem to fail with: Resulting in no storage locations available on the DN. This was supposed to be fixed by HDDS-14632, which is on the branch, but its still failing. Passes locally. EDIT: the failure was from an old run. The latest doesn't fail with this error! |
It failed for this commit: where af22a5c was the target branch state, from two weeks ago. It passes after feature branch |
| logAndEmit(msg); | ||
| throw new UpgradeException(msg, PREFINALIZE_VALIDATION_FAILED); | ||
| } | ||
| public void preFinalizeUpgrade(DatanodeStateMachine dsm) { |
There was a problem hiding this comment.
We can remove this override, it is the same as the parent.
| // outdated layout information. | ||
| // This operation is not idempotent. | ||
| if (checkpoint == FinalizationCheckpoint.MLV_EQUALS_SLV) { | ||
| upgradeContext.getNodeManager().forceNodesToHealthyReadOnly(); |
There was a problem hiding this comment.
We can actually delete forceNodesToHealthyReadOnly since this was the only caller outside of tests.
|
|
||
| void onLeaderReady(); | ||
|
|
||
| static boolean shouldCreateNewPipelines(FinalizationCheckpoint checkpoint) { |
There was a problem hiding this comment.
crossedCheckpoint can also be removed from this interface since it is now unused.
| * @throws SCMException if waiting is interrupted or SCM loses leadership | ||
| * @throws NotLeaderException if SCM is no longer the leader | ||
| */ | ||
| private void waitForDatanodesToFinalize(SCMUpgradeFinalizationContext context) |
There was a problem hiding this comment.
I don't think we need to block on the server side until all datadnodes finalize. Instead, I think this logic should be async in the heartbeat handling. When a pre-finalized datanode heartbeats to a finalized SCM, it should be instructed to finalize in the heartbeat response. This way we don't need any dedicated threads with interrupts/resumes on leader changes.
When the client instructs SCM to finalize, it can get a response when SCM has finished finalizing even if the DNs have not. For now we can use the existing finalization complete status in the response, but in follow up changes we will change how the status API works to indicate each component's finalization status individually.
There was a problem hiding this comment.
I have created HDDS-14669 to make this change in a followup, as I think changing this will impact tests etc. So better to do it on its own change.
| LOG.info("testPostUpgradeConditionsSCM: container state is {}", | ||
| ciState.name()); | ||
| assertTrue((ciState == HddsProtos.LifeCycleState.CLOSED) || | ||
| // Containers can now be in any state since we no longer close pipelines |
There was a problem hiding this comment.
Can we remove this test on container states completely? The new upgrade flow should be independent of any container states. There's a few other places in this test where I think we can remove similar checks.
I have filed the follow to continue this work: HDDS-14669 Waiting in finalization should not block a server thread |
What changes were proposed in this pull request?
When SCM finalizes an upgrade, it should no longer close all the Ratis pipelines on the datanodes. Instead they should be kept open. The SCM finalize command now needs to wait for all healthy datanodes to report matching SLV and MLV versions to know they have been finalized. Only when all datanodes are finalized, should SCM complete the finalization process.
This change is mostly to remove the existing close pipeline code and anything else that depended on it. The only new code added is the change to wait in DNs reporting SVL == MVL, as before new pipelines being created was the trigger to complete the process.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-14646
How was this patch tested?
Existing tests, some of which had to be adapted slightly.