Duo Zhang created HBASE-26144:
---------------------------------

             Summary: The HStore.snapshot method is never called in main code
                 Key: HBASE-26144
                 URL: https://issues.apache.org/jira/browse/HBASE-26144
             Project: HBase
          Issue Type: Improvement
          Components: regionserver
            Reporter: Duo Zhang
            Assignee: Duo Zhang


In the comment of HStore.flushCache, we say that HStore.snapshot method must be 
called first. But actually, we will call memstore.snapshot directly from 
StoreFlusherImpl.prepare, without holding the write lock. The reason we do not 
need to hold the write lock is that, we hold HRegion.updatesLock in the upper 
layer, so it is OK.

See HBASE-10087 for more discussion about this.

So in general, I think we could remove the snapshot method in HStore. And I do 
not think we need to hold the write lock when calling clearSnapshot then. As in 
the HRegion layer, we need to guarantee that there is only one ongoing flush of 
the region, so before we finish the region, it is already safe to operate on 
the snapshot of the memstore, especially that the clearSnapshot method itself 
is thread safe.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to