[ 
https://issues.apache.org/jira/browse/HBASE-8721?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13679339#comment-13679339
 ] 

Feng Honghua commented on HBASE-8721:
-------------------------------------

[~andrew.purt...@gmail.com] Consider this scenario: first put a KV with 
timestamp T0, and then delete it with timestamp T1 (T1>T0), and then put that 
KV again with timestamp T0. Now whether a get/scan can read out KV depends on 
whether a major compact occurs between the delete and second put, if there is a 
major compact occurs during that time frame, the delete will be collected by 
the major compact, therefore the second put survives and can be read out by a 
get/scan, on contrary if no major compact occurs during that time frame the 
second put and the first put will both be masked by the delete and can't be 
read out by get/scan. This means by current delete handling mechanism data's 
visibility sometimes depends on if a major compact occurs during a tricky time 
frame, this behaviour is weird and unacceptable since major compact should be 
transparent to end users and should by no means have impact on data's 
visibility.
And the behaviour that a later put can be masked by a earlier delete itself is 
somewhat weird and can make end users confusing in many scenarios. Some HBase 
users in our company complain about this behaviour and claim this behaviour is 
unacceptable from their end users' viewpoint. And I also noticed there is a 
same discussion on this issue by jira HBASE-2256
                
> fix for bug that delete can mask puts that happened after the delete was 
> entered
> --------------------------------------------------------------------------------
>
>                 Key: HBASE-8721
>                 URL: https://issues.apache.org/jira/browse/HBASE-8721
>             Project: HBase
>          Issue Type: Bug
>          Components: regionserver
>            Reporter: Feng Honghua
>         Attachments: HBASE-8721-0.94-V0.patch
>
>
> this fix aims for bug mentioned in http://hbase.apache.org/book.html 5.8.2.1:
> "Deletes mask puts, even puts that happened after the delete was entered. 
> Remember that a delete writes a tombstone, which only disappears after then 
> next major compaction has run. Suppose you do a delete of everything <= T. 
> After this you do a new put with a timestamp <= T. This put, even if it 
> happened after the delete, will be masked by the delete tombstone. Performing 
> the put will not fail, but when you do a get you will notice the put did have 
> no effect. It will start working again after the major compaction has run. 
> These issues should not be a problem if you use always-increasing versions 
> for new puts to a row. But they can occur even if you do not care about time: 
> just do delete and put immediately after each other, and there is some chance 
> they happen within the same millisecond."

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to