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

Feng Honghua commented on HBASE-10252:
--------------------------------------

bq.The test presumes that even though the increment value is 0, if the cell 
does not exist yet, then the cell is created (with a value of 0). That is how 
it worked in 0.96 and previous. My guess is that you did not intend to remove 
this behavior? If that is the case, I'll make a small patch in a new issue to 
restore cell creation though the value is zero. Thanks boss.
This patch is to save the write to wal/memstore when the increment value is 0, 
so 'if the increment value is 0, and if the cell does not exist yet, then the 
cell won't be created' is a natural resultant behavior of this patch...
I'm not familiar with asynchbase itself, but wonder why it cares about whether 
a cell exists after an increment operation? seems what really matters from a 
'client' perspective is whether the value it reads back is correct after some 
increment is performed (such as a read can confirm that the value it reads back 
is 0 immediately after a first increment with value=0, if that's the case, it's 
deemed correct, it shouldn't care about whether that cell exists or not. The 
value is 0 for increment under both scenarios 1) non-existing cell and 2) an 
existing cell with value=0). if my understanding is correct, seems the 
according asynchbase test,rather than the hbase code,should be corrected here. 
:-)

> Don't write back to WAL/memstore when Increment amount is zero (mostly for 
> query rather than update intention)
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: HBASE-10252
>                 URL: https://issues.apache.org/jira/browse/HBASE-10252
>             Project: HBase
>          Issue Type: Improvement
>          Components: regionserver
>            Reporter: Feng Honghua
>            Assignee: Feng Honghua
>             Fix For: 0.98.0, 0.99.0
>
>         Attachments: HBASE-10252-trunk-v0.patch, HBASE-10252-trunk-v1.patch
>
>
> When user calls Increment by providing amount=0, we don't write the original 
> value to WAL or memstore : adding 0 yields a 'new' value just with the same 
> value as the original one.
> 1. user provides 0 amount for query rather than for update, this fix is ok; 
> this intention is the most possible case;
> 2. user provides 0 amount for an update, this fix is also ok : no need to 
> touch back-end value if that value isn't changed;
> 3. either case we both return correct value, and keep subsequent query 
> results correct : if the 0 amount Increment is the first update, the query is 
> the same for retrieving a 0 value or retrieving nothing;



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to