[
https://issues.apache.org/jira/browse/HBASE-17487?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15829722#comment-15829722
]
Anastasia Braginsky commented on HBASE-17487:
---------------------------------------------
Dear [~ted_yu],
What you see is not a bug, as explained in the comments inside the loop. This
loop can not iterate more than two times for the following reason.
1. pushPipelineToSnapshot() method is invoked only from snapshot() method,
which is invoked under region's updatesLock taken. Therefore no updates are
happening while pushPipelineToSnapshot() is in progress.
2. Compaction pipeline's swap() method can fail only if there was another
pipeline update in parallel, which means concurrent swap or push to pipeline.
a. Concurrent push to pipeline can not happen, because there are no
concurrent memstore updates (updatesLock taken)
b. Concurrent swap can happen only from concurrently finishing pipeline
compaction. But after that another concurrent pipeline compaction can not start
and disturb us once again, because there is no in-memory-flush, because there
are no memstore updates.
>From all that, the swap() method can fail only once, in time when
>pushPipelineToSnapshot() method is invoked. Thus, the 3rd iteration should
>never happen.
> Potential data loss when pipeline is pushed to snapshot
> -------------------------------------------------------
>
> Key: HBASE-17487
> URL: https://issues.apache.org/jira/browse/HBASE-17487
> Project: HBase
> Issue Type: Bug
> Reporter: Ted Yu
> Assignee: Ted Yu
> Attachments: 17487.v1.txt
>
>
> In CompactingMemStore#pushPipelineToSnapshot() , there is limit of 3
> iterations of pipeline.swap() call after which an empty ImmutableSegment is
> used as snapshot.
> However, after 3rd iteration, the return value from swap() is not checked.
> If the 3rd swap() call is successful, the versioned list would be swapped
> with null in pipeline and snapshot being overwritten with the empty
> ImmutableSegment.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)