sodonnel opened a new pull request #521: HDDS-2592 Add Datanode command to allow the datanode to persist its admin state URL: https://github.com/apache/hadoop-ozone/pull/521 ## What changes were proposed in this pull request? When the datanode state is change in SCMNodeManager a Datanode Command is created to transmit the new datanode state to the datanode. The datanode will then persist this state in the "datanodeID.yaml" file. The current datanode.yaml file simply persists a DatanodeDetails object in YAML format. Therefore two new fields have been added to DatanodeDetails to support this: persistedOpState, persistedOpStateExpiryEpochSec The first is the operational state and the second is the seconds from the epoch the setting should expire (for maintenance mode). When a datanode starts up, it will read these values and supply them in the heartbeat to SCM. If SCM notices the DN was registered before, SCM is seen as the source of truth and will update the DN state to that set in SCM if they differ. If the DN was never registered with SCM (eg if SCM was restarted), then the DN state is seen as the source of truth and SCM will be updated accordingly. This change also moves the state expiry time into the NodeStatus object, so it now carries operationalState, healthState and State expiry. Note that the DN does not do anything with the persisted operational state. They are simply persisted and reported in the heartbeat. In this respect the DNs are being used as a form of distributed storage for the operational state so the decommission process can survive a restart. ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-2592 ## How was this patch tested? Tested manually using a docker build. This change still needs unit tests added if the current approach is agreed upon.
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
