hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject [2/7] hbase git commit: HBASE-18330 NPE in ReplicationZKLockCleanerChore
Date Wed, 19 Jul 2017 23:21:23 GMT
HBASE-18330 NPE in ReplicationZKLockCleanerChore


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/cbf39042
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/cbf39042
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/cbf39042

Branch: refs/heads/branch-2
Commit: cbf390422b988b0fd4466c36bc8e4c767903e63c
Parents: 51067ca
Author: Andrew Purtell <apurtell@apache.org>
Authored: Wed Jul 19 15:46:08 2017 -0700
Committer: Andrew Purtell <apurtell@apache.org>
Committed: Wed Jul 19 15:46:22 2017 -0700

----------------------------------------------------------------------
 .../apache/hadoop/hbase/replication/ReplicationPeersZKImpl.java   | 3 +++
 .../hadoop/hbase/replication/ReplicationQueuesClientZKImpl.java   | 2 +-
 .../hadoop/hbase/master/cleaner/ReplicationZKNodeCleaner.java     | 3 +++
 .../hbase/replication/regionserver/DumpReplicationQueues.java     | 3 +++
 4 files changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/cbf39042/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeersZKImpl.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeersZKImpl.java
b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeersZKImpl.java
index 02fe2f1..751e454 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeersZKImpl.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeersZKImpl.java
@@ -520,6 +520,9 @@ public class ReplicationPeersZKImpl extends ReplicationStateZKBase implements
Re
     if (queuesClient == null) return;
     try {
       List<String> replicators = queuesClient.getListOfReplicators();
+      if (replicators == null || replicators.isEmpty()) {
+        return;
+      }
       for (String replicator : replicators) {
         List<String> queueIds = queuesClient.getAllQueues(replicator);
         for (String queueId : queueIds) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/cbf39042/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesClientZKImpl.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesClientZKImpl.java
b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesClientZKImpl.java
index 0504373..0115b6f 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesClientZKImpl.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesClientZKImpl.java
@@ -98,7 +98,7 @@ public class ReplicationQueuesClientZKImpl extends ReplicationStateZKBase
implem
     for (int retry = 0; ; retry++) {
       int v0 = getQueuesZNodeCversion();
       List<String> rss = getListOfReplicators();
-      if (rss == null) {
+      if (rss == null || rss.isEmpty()) {
         LOG.debug("Didn't find any region server that replicates, won't prevent any deletions.");
         return ImmutableSet.of();
       }

http://git-wip-us.apache.org/repos/asf/hbase/blob/cbf39042/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/ReplicationZKNodeCleaner.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/ReplicationZKNodeCleaner.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/ReplicationZKNodeCleaner.java
index dafc4f8..6d8962e 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/ReplicationZKNodeCleaner.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/ReplicationZKNodeCleaner.java
@@ -77,6 +77,9 @@ public class ReplicationZKNodeCleaner {
     Set<String> peerIds = new HashSet<>(this.replicationPeers.getAllPeerIds());
     try {
       List<String> replicators = this.queuesClient.getListOfReplicators();
+      if (replicators == null || replicators.isEmpty()) {
+        return undeletedQueues;
+      }
       for (String replicator : replicators) {
         List<String> queueIds = this.queuesClient.getAllQueues(replicator);
         for (String queueId : queueIds) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/cbf39042/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/DumpReplicationQueues.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/DumpReplicationQueues.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/DumpReplicationQueues.java
index 2bedbfd..4bda75b 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/DumpReplicationQueues.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/DumpReplicationQueues.java
@@ -323,6 +323,9 @@ public class DumpReplicationQueues extends Configured implements Tool
{
     // Loops each peer on each RS and dumps the queues
     try {
       List<String> regionservers = queuesClient.getListOfReplicators();
+      if (regionservers == null || regionservers.isEmpty()) {
+        return sb.toString();
+      }
       for (String regionserver : regionservers) {
         List<String> queueIds = queuesClient.getAllQueues(regionserver);
         replicationQueues.init(regionserver);


Mime
View raw message