avijayanhwx commented on a change in pull request #1613:
URL: https://github.com/apache/ozone/pull/1613#discussion_r536442371
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/upgrade/OMPrepareRequest.java
##########
@@ -166,36 +166,29 @@ private static void waitForDoubleBufferFlush(
*/
public static long takeSnapshotAndPurgeLogs(RaftServerImpl impl)
throws IOException {
-
StateMachine stateMachine = impl.getStateMachine();
long snapshotIndex = stateMachine.takeSnapshot();
+ RaftLog raftLog = impl.getState().getLog();
+ long raftLogIndex = raftLog.getLastEntryTermIndex().getIndex();
- // If the snapshot indices from Ratis and the state machine do not match,
- // the exception is propagated, resulting in an error response to the
- // client. They can retry the prepare request.
- if (snapshotIndex != stateMachine.getLastAppliedTermIndex().getIndex()) {
- throw new IOException("Index from Snapshot does not match last applied "
+
- "Index");
+ if (snapshotIndex != raftLogIndex) {
Review comment:
@bharatviswa504 That will be the next work item in the prepare OM
feature.
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]