ramkrish86 commented on a change in pull request #214: HBASE-22072 High 
read/write intensive regions may cause long crash
URL: https://github.com/apache/hbase/pull/214#discussion_r281119785
 
 

 ##########
 File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java
 ##########
 @@ -876,8 +885,25 @@ public void updateReaders(List<HStoreFile> sfs, 
List<KeyValueScanner> memStoreSc
     if (CollectionUtils.isEmpty(sfs) && 
CollectionUtils.isEmpty(memStoreScanners)) {
       return;
     }
+    boolean updateReaders = false;
     flushLock.lock();
     try {
+      if (!closeLock.tryLock()) {
+        // The reason for doing this is that when the current store scanner 
does not retrieve
+        // any new cells, then the scanner is considered to be done. The heap 
of this scanner
+        // is not closed till the shipped() call is completed. Hence in that 
case if at all
+        // the partial close (close (false)) has been called before 
updateReaders(), there is no
+        // need for the updateReaders() to happen.
+        LOG.debug("StoreScanner already has the close lock. There is no need 
to updateReaders");
+        // no lock acquired.
+        return;
+      }
+      // lock acquired
+      updateReaders = true;
+      if (this.closing) {
 
 Review comment:
   Should we really change this 'closing' to volatile? I was thinking now it is 
not needed as we are anyway restricting the parallel access. Also 'closing' is 
getting used in other code flow. So thought it is going to add some overhead by 
making it volatile.

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

Reply via email to