hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject [7/7] hbase git commit: HBASE-18330 NPE in ReplicationZKLockCleanerChore
Date Wed, 19 Jul 2017 23:21:28 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/b03a5e74
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/b03a5e74
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/b03a5e74

Branch: refs/heads/branch-1.1
Commit: b03a5e743952495e97c1c180e272a08c4b2eb56f
Parents: ff7df56
Author: Andrew Purtell <apurtell@apache.org>
Authored: Wed Jul 19 15:46:45 2017 -0700
Committer: Andrew Purtell <apurtell@apache.org>
Committed: Wed Jul 19 15:59:40 2017 -0700

----------------------------------------------------------------------
 .../apache/hadoop/hbase/replication/ReplicationPeersZKImpl.java  | 1 -
 .../hbase/master/cleaner/ReplicationZKLockCleanerChore.java      | 4 +++-
 .../hadoop/hbase/replication/master/ReplicationLogCleaner.java   | 2 +-
 .../hbase/replication/regionserver/ReplicationSourceManager.java | 2 +-
 4 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/b03a5e74/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 da9ae15..048a623 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
@@ -561,5 +561,4 @@ public class ReplicationPeersZKImpl extends ReplicationStateZKBase implements
Re
     return ProtobufUtil.prependPBMagic(bytes);
   }
 
-
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/b03a5e74/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/ReplicationZKLockCleanerChore.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/ReplicationZKLockCleanerChore.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/ReplicationZKLockCleanerChore.java
index dc5338e..3fa30bf 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/ReplicationZKLockCleanerChore.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/ReplicationZKLockCleanerChore.java
@@ -76,7 +76,9 @@ public class ReplicationZKLockCleanerChore extends ScheduledChore {
       }
       Set<String> rsSet = new HashSet<String>(regionServers);
       List<String> replicators = queues.getListOfReplicators();
-
+      if (replicators == null || replicators.isEmpty()) {
+        return;
+      }
       for (String replicator: replicators) {
         try {
           String lockNode = queues.getLockZNode(replicator);

http://git-wip-us.apache.org/repos/asf/hbase/blob/b03a5e74/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/master/ReplicationLogCleaner.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/master/ReplicationLogCleaner.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/master/ReplicationLogCleaner.java
index 9ecba11..7731240 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/master/ReplicationLogCleaner.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/master/ReplicationLogCleaner.java
@@ -98,7 +98,7 @@ public class ReplicationLogCleaner extends BaseLogCleanerDelegate {
     for (int retry = 0; ; retry++) {
       int v0 = replicationQueues.getQueuesZNodeCversion();
       List<String> rss = replicationQueues.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/b03a5e74/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
index 81f06a3..51c3c31 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
@@ -221,7 +221,7 @@ public class ReplicationSourceManager implements ReplicationListener {
       addSource(id);
     }
     List<String> currentReplicators = this.replicationQueues.getListOfReplicators();
-    if (currentReplicators == null || currentReplicators.size() == 0) {
+    if (currentReplicators == null || currentReplicators.isEmpty()) {
       return;
     }
     List<String> otherRegionServers = replicationTracker.getListOfRegionServers();


Mime
View raw message