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

Ted Yu commented on HBASE-18282:
--------------------------------

{code}
+  public void setConf(Configuration conf, ZKWatcher zk, 
ReplicationQueuesClient replicationQueuesClient) {
{code}
Wrap long line.
{code}
+          try {
+            Thread.sleep(30000 + ThreadLocalRandom.current().nextInt(30000));
{code}
Can we use shorter sleep interval ?
{code}
+          } catch (InterruptedException e2) {
+            LOG.warn("Interrupted while waiting for list of replicators to be 
available", e2);
{code}
Restore interrupt status and break.



> ReplicationLogCleaner can delete WALs not yet replicated in case of a 
> KeeperException
> -------------------------------------------------------------------------------------
>
>                 Key: HBASE-18282
>                 URL: https://issues.apache.org/jira/browse/HBASE-18282
>             Project: HBase
>          Issue Type: Bug
>          Components: Replication
>    Affects Versions: 1.3.1, 1.2.6, 1.1.11, 2.0.0-alpha-1
>            Reporter: Ashu Pachauri
>            Priority: Critical
>         Attachments: HBASE-18282-branch-1.patch, HBASE-18282-branch-2.patch
>
>
> ReplicationStateZKBase#getListOfReplicators does not rethrow a 
> KeeperException and returns null in such a case. ReplicationLogCleaner just 
> assumes that there are no replicators and deletes everything.
> ReplicationStateZKBase:
> {code:java}
> public List<String> getListOfReplicators() {
>     List<String> result = null;
>     try {
>       result = ZKUtil.listChildrenNoWatch(this.zookeeper, this.queuesZNode);
>     } catch (KeeperException e) {
>       this.abortable.abort("Failed to get list of replicators", e);
>     }
>     return result;
>   }
> {code}
> ReplicationLogCleaner:
> {code:java}
> private Set<String> loadWALsFromQueues() throws KeeperException {
>     for (int retry = 0; ; retry++) {
>       int v0 = replicationQueues.getQueuesZNodeCversion();
>       List<String> rss = replicationQueues.getListOfReplicators();
>       if (rss == null) {
>         LOG.debug("Didn't find any region server that replicates, won't 
> prevent any deletions.");
>         return ImmutableSet.of();
>       }
>       ...
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to