This is an automated email from the ASF dual-hosted git repository.
apurtell pushed a commit to branch branch-2.5
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2.5 by this push:
new 73c26a62aef HBASE-29684 Replication peer config is not honored in few
cases (#7413)
73c26a62aef is described below
commit 73c26a62aefb23ed3a5a37afe29be70f874ab94f
Author: Aman Poonia <[email protected]>
AuthorDate: Tue Nov 4 06:02:27 2025 +0530
HBASE-29684 Replication peer config is not honored in few cases (#7413)
Signed-off-by: Andrew Purtell <[email protected]>
Signed-off-by: Viraj Jasani <[email protected]>
---
.../hbase/master/replication/ReplicationPeerManager.java | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/ReplicationPeerManager.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/ReplicationPeerManager.java
index 73166fb8bed..080820bbd22 100644
---
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/ReplicationPeerManager.java
+++
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/ReplicationPeerManager.java
@@ -31,7 +31,6 @@ import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.DoNotRetryIOException;
-import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.ReplicationPeerNotFoundException;
import org.apache.hadoop.hbase.ServerName;
import org.apache.hadoop.hbase.TableName;
@@ -274,7 +273,7 @@ public class ReplicationPeerManager {
checkClusterKey(peerConfig.getClusterKey());
// Check if endpoint can replicate to the same cluster
if (endpoint == null || !endpoint.canReplicateToSameCluster()) {
- checkSameClusterKey(peerConfig.getClusterKey());
+ checkSameClusterKey(peerConfig);
}
}
@@ -372,21 +371,22 @@ public class ReplicationPeerManager {
}
}
- private void checkSameClusterKey(String clusterKey) throws
DoNotRetryIOException {
+ private void checkSameClusterKey(ReplicationPeerConfig peerConfig) throws
DoNotRetryIOException {
String peerClusterId = "";
try {
- // Create the peer cluster config for get peer cluster id
- Configuration peerConf = HBaseConfiguration.createClusterConf(conf,
clusterKey);
+ // Create the peer cluster config for getting peer cluster id, honoring
per-peer CONFIG
+ Configuration peerConf =
ReplicationUtils.getPeerClusterConfiguration(peerConfig, conf);
try (ZKWatcher zkWatcher = new ZKWatcher(peerConf, this +
"check-peer-cluster-id", null)) {
peerClusterId = ZKClusterId.readClusterIdZNode(zkWatcher);
}
- } catch (IOException | KeeperException e) {
- throw new DoNotRetryIOException("Can't get peerClusterId for
clusterKey=" + clusterKey, e);
+ } catch (IOException | KeeperException | ReplicationException e) {
+ throw new DoNotRetryIOException(
+ "Can't get peerClusterId for clusterKey=" +
peerConfig.getClusterKey(), e);
}
// In rare case, zookeeper setting may be messed up. That leads to the
incorrect
// peerClusterId value, which is the same as the source clusterId
if (clusterId.equals(peerClusterId)) {
- throw new DoNotRetryIOException("Invalid cluster key: " + clusterKey
+ throw new DoNotRetryIOException("Invalid cluster key: " +
peerConfig.getClusterKey()
+ ", should not replicate to itself for
HBaseInterClusterReplicationEndpoint");
}
}