[ https://issues.apache.org/jira/browse/HBASE-10087?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14163290#comment-14163290 ]
zhangduo commented on HBASE-10087: ---------------------------------- I think the lock here is not used to prevent concurrent snapshot of memstore, but to prevent create MemStoreScanner(holding the read lock) and snapshot running concurrently. If we do not hold write lock here, we can get an inconsistent view of kvsetAtCreation, snapshotAtCreation, allocator and snapshotAllocator when creating MemStoreScanner(kvsetAtCreation and snapshotAtCreation could be a same instance, snapshotAllocator is not the actual allocator of snapshotAtCreation and so on). This is OK for now because our implementation(very very tricky), but I do not think it is a good idea to leave a data racing bomb here... > Store should be locked during a memstore snapshot > ------------------------------------------------- > > Key: HBASE-10087 > URL: https://issues.apache.org/jira/browse/HBASE-10087 > Project: HBase > Issue Type: Bug > Components: regionserver > Affects Versions: 0.98.0, 0.96.1, 0.94.14 > Reporter: Nicolas Liochon > Assignee: Nicolas Liochon > Fix For: 0.98.0, 0.99.0 > > Attachments: 10079.v1.patch, 10087.v2.patch > > > regression from HBASE-9963, found while looking at HBASE-10079. -- This message was sent by Atlassian JIRA (v6.3.4#6332)