avijayanhwx commented on a change in pull request #1692:
URL: https://github.com/apache/ozone/pull/1692#discussion_r542569283



##########
File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/protocolPB/OzoneManagerRequestHandler.java
##########
@@ -623,6 +633,24 @@ private FinalizeUpgradeProgressResponse 
reportUpgradeProgress(
         .build();
   }
 
+  private PrepareStatusResponse getPrepareStatus(PrepareStatusRequest request)
+      throws IOException {
+    // TODO After HDDS-4569,
+    // When there is a global "prepared" state in OM, we can return
+    // PREPARE_NOT_STARTED instead of PREPARE_IN_PROGRESS appropriately.
+    PrepareStatus prepareStatus = null;
+    long txnID = request.getTxnID();
+    long ratisSnapshotIndex = impl.getRatisSnapshotIndex();
+    if (ratisSnapshotIndex != txnID) {
+      LOG.info("Last Txn Index = {}", ratisSnapshotIndex);
+      prepareStatus =  PREPARE_IN_PROGRESS;

Review comment:
       As mentioned in an earlier comment, this can undergo some minor changes 
after HDDS-4569. Currently, in my mind, an OM in prepared flag disabled state 
(state maintained in global OM level) does not know about a OmPrepareRequest 
(think slow follower). When the flag has been enabled but still is waiting for 
the flush, then it is likely in PREPARE_IN_PROGRESS mode. When the flag is 
enabled, and the flush is done (OMPR apply txn is fully complete), then we are 
expected to be PREPARE_COMPLETED state. Of course there are some edge cases 
that can be caused by subsequent OMPrepareRequests coming in the pipeline, but 
I don't expect them to be a big problem to the fundamental problem the prepare 
operation is trying to solve.




----------------------------------------------------------------
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]

Reply via email to