tkhurana commented on a change in pull request #1215:
URL: https://github.com/apache/phoenix/pull/1215#discussion_r627762679



##########
File path: 
phoenix-core/src/main/java/org/apache/phoenix/hbase/index/IndexRegionObserver.java
##########
@@ -926,57 +1051,84 @@ private void waitForPreviousConcurrentBatch(TableName 
table, BatchMutateContext
                 // lastContext.getMaxPendingRowCount() is the depth of the 
subtree rooted at the batch pointed by lastContext
                 if (!countDownLatch.await((lastContext.getMaxPendingRowCount() 
+ 1) * concurrentMutationWaitDuration,
                         TimeUnit.MILLISECONDS)) {
+                    LOG.debug(String.format("latch timeout context %s last 
%s", context, lastContext));
                     done = false;
-                    break;
                 }
                 // Acquire the locks again before letting the region proceed 
with data table updates
                 lockRows(context);
+                if (!done) {
+                    // previous concurrent batch did not complete so we have 
to retry this batch
+                    break;
+                } else {
+                    // read the phase again to determine the status of 
previous batch
+                    phase = lastContext.getCurrentPhase();
+                    LOG.debug(String.format("context %s last %s exit phase 
%s", context, lastContext, phase));

Review comment:
       @gjacoby126 toString() is the default implementation that returns a 
string of the form of `BatchMutateContext@<hex representation of the memory 
location the instantiated object>`. The intent of the log message is to see how 
different batch mutate context objects are linked together so we just need a 
unique id for every instantiated batch mutate context object 




-- 
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:
us...@infra.apache.org


Reply via email to