comnetwork commented on a change in pull request #3859:
URL: https://github.com/apache/hbase/pull/3859#discussion_r757218697



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
##########
@@ -1222,6 +1225,14 @@ private boolean updateStorefiles(List<HStoreFile> sfs, 
long snapshotId) throws I
     this.lock.writeLock().lock();
     try {
       this.storeEngine.getStoreFileManager().insertNewFiles(sfs);
+      /**
+       * NOTE:we should keep clearSnapshot method inside the write lock 
because clearSnapshot may
+       * close {@link DefaultMemStore#snapshot}, which may be used by
+       * {@link DefaultMemStore#getScanners}.
+       */
+      if (snapshotId > 0) {

Review comment:
       @Apache9,  thank you very much for code view, yes, you are right, and I 
also find that reference count implementation  of ` MemStoreLABImpl `is flawed 
because its checking and increasing or decreasing is not done in atomicity and 
it ignores state checking  when there  is illegal state in reference count(eg. 
increasing or decreasing when the resource is already freed) and it may hidden 
another bug in flushing, I would try to fix it.




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to