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

Duo Zhang commented on HBASE-26447:
-----------------------------------

Maybe we could implement special DoNotRetryIOExceptions, which are called 
PeerNotDisabledException and PeerNotEnabledException, just like 
TableNotDisabledException and TableNotEnabledException, so at client it is 
easier for us to ignore these exceptions?

> Make enableReplicationPeer/disableReplicationPeer idempotent
> ------------------------------------------------------------
>
>                 Key: HBASE-26447
>                 URL: https://issues.apache.org/jira/browse/HBASE-26447
>             Project: HBase
>          Issue Type: Improvement
>          Components: Admin, Replication
>            Reporter: Nishtha Shah
>            Assignee: Nishtha Shah
>            Priority: Minor
>
> When enableReplicationPeer is called and the peer is already enabled, 
> DoNotRetryIOException is being thrown as part of preEnablePeer 
> [here|https://github.com/apache/hbase/blob/master/hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/ReplicationPeerManager.java#L164],
>  similarly with disableReplicationPeer 
> [here|https://github.com/apache/hbase/blob/master/hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/ReplicationPeerManager.java#L171].
> java.lang.RuntimeException: org.apache.hadoop.hbase.DoNotRetryIOException: 
> Replication peer 1 has already been enabled
> Ideally, it should not throw a runtimeException, if the peer is already in 
> desired state
> Either 1. we should add a check before trying to enable/disable peer, and if 
> it is already enabled return, else enable the peer or
> 2. Log the message instead of throwing exception in 
> preEnablePeer/preDisablePeer



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to