hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ramkrishna.s.vasudevan (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-13393) Add facility to disable tags after parent goes in
Date Tue, 26 May 2015 11:22:18 GMT

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

ramkrishna.s.vasudevan commented on HBASE-13393:
------------------------------------------------

The threading model in this case would be like
-> The memstore add() is going to be called by multiple threads and so the volatile variable
would be read every time and the first thread that sees a tag tries to update it.  Other threads
once written would see the updated value.
In the snapshot() API there is going to be only one thread that is going to read the updated
value. During snapshot() we hold a write lock so there is no updates happening via add().
Wanted to confirm the behaviour of volatile so went thro this blog
http://tutorials.jenkov.com/java-concurrency/volatile.html.

{code}
But in case one thread reads and writes the value of a volatile variable, and other threads
only read the variable, then the reading threads are guaranteed to see the latest value written
to the volatile variable. Without making the variable volatile, this would not be guaranteed.
{code}
Here once the update happens then it is only reads by multiple threads.  
I think we would need a volatile here because multiple threads could update the value of tagsAvailable
but the flush thread may not see the actual updated value.  It may be better to remove the
!tagsAvailable check and always update the tagsAvailable boolean to true.  Does that make
sense here?

> Add facility to disable tags after parent goes in
> -------------------------------------------------
>
>                 Key: HBASE-13393
>                 URL: https://issues.apache.org/jira/browse/HBASE-13393
>             Project: HBase
>          Issue Type: Sub-task
>            Reporter: stack
>            Assignee: stack
>         Attachments: HBASE-13393.patch, HBASE-13393_1.patch
>
>
> We used to specify 'no tags' by choosing to write files that were version 2.  After parent
goes in, make it so can ask a v3 file not to write tags.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message