You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by "Duo Zhang (Jira)" <ji...@apache.org> on 2021/07/31 07:30:00 UTC

[jira] [Resolved] (HBASE-26144) The HStore.snapshot method is never called in main code

     [ https://issues.apache.org/jira/browse/HBASE-26144?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Duo Zhang resolved HBASE-26144.
-------------------------------
    Fix Version/s: 3.0.0-alpha-2
                   2.5.0
     Hadoop Flags: Reviewed
       Resolution: Fixed

Pushed to master and branch-2.

Thanks [~niuyulin] for reviewing.

> 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
>            Priority: Major
>             Fix For: 2.5.0, 3.0.0-alpha-2
>
>
> 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)