Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-26144

The HStore.snapshot method is never called in main code

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.5.0, 3.0.0-alpha-2
    • regionserver
    • None
    • Reviewed

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              zhangduo Duo Zhang
              zhangduo Duo Zhang
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: