hanishakoneru commented on a change in pull request #948: HDDS-1649. On
installSnapshot notification from OM leader, download checkpoint and reload OM
state
URL: https://github.com/apache/hadoop/pull/948#discussion_r304662467
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
##########
@@ -3122,6 +3136,131 @@ public boolean setAcl(OzoneObj obj, List<OzoneAcl>
acls) throws IOException {
}
}
+ /**
+ * Download and install latest checkpoint from leader OM.
+ * If the download checkpoints snapshot index is greater than this OM's
+ * last applied transaction index, then re-initialize the OM state via this
+ * checkpoint. Before re-initializing OM state, the OM Ratis server should
+ * be stopped so that no new transactions can be applied.
+ * @param leaderId peerNodeID of the leader OM
+ * @return If checkpoint is installed, return the corresponding termIndex.
+ * Otherwise, return null.
+ */
+ public TermIndex installSnapshot(String leaderId) {
+ if (omSnapshotProvider == null) {
+ LOG.error("OM Snapshot Provider is not configured as there are no peer "
+
+ "nodes.");
+ return null;
+ }
+
+ DBCheckpoint omDBcheckpoint;
+ try {
+ omDBcheckpoint = omSnapshotProvider.getOzoneManagerDBSnapshot(leaderId);
Review comment:
This was temporary till RATIS-564. Fixed now.
----------------------------------------------------------------
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]