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

Anoop Sam John commented on HBASE-11639:
----------------------------------------

Thinking abt a solution for this, 2 previous POC patches we made.

Option 1 : Write the vis label tag in String form *only* into Cells added to 
WAL. Here this will affect the recovery time during RS crash as we will have to 
do Expression parsing, expansion and recreation of KV and so bytes copying etc  
etc.  Also this approach will need us to add more CP hooks during the log 
replay stage

Option 2 : To the WAL cell, write both expanded vis exp tags (ie. with label 
ordinals) as well as one tag with the vis exp String form itself. This will 
avoid all the MTTR down sides.  But we will end up in writing more tag data 
into WAL cells. There is already concern for limited total tags length. Also if 
recovery happens and WAL cells gets replayed, those will have extra tag data 
and will get written to HFile and staying there from then on. (If we have to 
avoid this, we will need extra op in Log recovery with stripping of one tag 
which is like a no light op at least now)

So I was thinking for an alternate way.

Now in branch-1+ we have pluggable ReplicationEndpoint support. How about we 
have a wrapper impl wrapping the HBaseInterClusterReplicationEndpoint.  We can 
impl replicate(ReplicateContext replicateContext) and in this we will rewrite 
the WALEdit cells not to have the ordinal based tags but the String based one 
and then calling the delegator to actually replicate.
Add a hook in RegionServerObserver to have pre/post hooks while creation of the 
Replication Endpoint and we can do the wrap work in this hook impl in VC.

Right now WALEdit allows KVs only in it. So the recreation will need us to do 
bytes copy for the key and value parts also even though there is no change. 
HBASE-11805 will solve this. If it takes cells, we can have a new Cell impl in 
which the KV part actually refers to the original Cell what we got in 
ReplicationContext's WALEdit. Only the tags array we can recreate.

This will need us to back port the pluggable ReplicationEndpoint stuff to 0.98. 
Discussing offline with [~apurtell] he is ok for this if it can be done with 
out any BC or wire compatibility issue (It should be possible I believe)

> [Visibility controller] Replicate the visibility of Cells as strings
> --------------------------------------------------------------------
>
>                 Key: HBASE-11639
>                 URL: https://issues.apache.org/jira/browse/HBASE-11639
>             Project: HBase
>          Issue Type: Improvement
>          Components: Replication, security
>    Affects Versions: 0.98.4
>            Reporter: ramkrishna.s.vasudevan
>            Assignee: ramkrishna.s.vasudevan
>              Labels: VisibilityLabels
>             Fix For: 0.99.0, 2.0.0, 0.98.7
>
>
> This issue is aimed at persisting the visibility labels as strings in the WAL 
> rather than Label ordinals.  This would help in replicating the label 
> ordinals to the replication cluster as strings directly and also that after 
> HBASE-11553 would help because the replication cluster could have an 
> implementation as string based visibility labels.



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

Reply via email to