hanishakoneru commented on a change in pull request #276: HDDS-2637. Handle
LeaderNot ready exception in OzoneManager StateMachine and upgrade ratis to
latest version.
URL: https://github.com/apache/hadoop-ozone/pull/276#discussion_r351541047
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMDBCheckpointServlet.java
##########
@@ -115,15 +117,24 @@ public void doGet(HttpServletRequest request,
HttpServletResponse response) {
takeRatisSnapshot = Boolean.valueOf(snapshotBeforeCheckpointParam);
}
- long ratisSnapshotIndex;
+ long ratisSnapshotIndex = -1L;
+ long ratisSnapshotTermIndex = -1L;
+ boolean setBothHeaders = false;
if (takeRatisSnapshot) {
// If OM follower is downloading the checkpoint, we should save a
// ratis snapshot first. This step also included flushing the OM DB.
// Hence, we can set flush to false.
+
+ // We need to set both snapshot term index and snapshot index.
flush = false;
- ratisSnapshotIndex = om.saveRatisSnapshot();
+ TermIndex lastAppliedTermIndex = om.saveRatisSnapshot();
+ ratisSnapshotTermIndex = lastAppliedTermIndex.getTerm();
+ ratisSnapshotIndex = lastAppliedTermIndex.getIndex();
+ setBothHeaders = true;
} else {
ratisSnapshotIndex = om.getRatisSnapshotIndex();
+ response.setHeader(OM_RATIS_SNAPSHOT_INDEX,
+ String.valueOf(ratisSnapshotIndex));
Review comment:
We do not need to set Snapshot Index in this case.
----------------------------------------------------------------
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]