bharatviswa504 commented on a change in pull request #1613:
URL: https://github.com/apache/ozone/pull/1613#discussion_r536443445



##########
File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/upgrade/OMPrepareRequest.java
##########
@@ -137,16 +137,21 @@ private static void waitForDoubleBufferFlush(
       // If no transactions have been persisted to the DB, transaction info
       // will be null, not zero, causing a null pointer exception within
       // ozoneManager#getRatisSnaphotIndex.
-      // Get the transaction directly instead.
-      OMTransactionInfo txnInfo = ozoneManager.getMetadataManager()
+      // Get the transaction directly instead to handle the case when it is
+      // null.
+      OMTransactionInfo dbTxnInfo = ozoneManager.getMetadataManager()
           .getTransactionInfoTable().get(TRANSACTION_INFO_KEY);
-      if (txnInfo == null) {
-        success = (txnLogIndex == 0);
+      if (dbTxnInfo == null) {
+        // If there are no transactions in the DB, we are prepared to log

Review comment:
       Ohh misread the condition indexToWaitFor==0, indexTowaitFor will never 
be zero, so in case when doubleBuffer flush fails to flush this condition is 
not met. Is my understanding correct?




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