hbase-commits mailing list archives

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

Branch: refs/heads/branch-1.3
Commit: 2b60f4ecd98da8b4c74f044cc1ec0d221d960399
Parents: 8aabbdb
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:55:56 2017 -0700

----------------------------------------------------------------------
 .../apache/hadoop/hbase/replication/ReplicationPeersZKImpl.java  | 3 +++
 .../hbase/master/cleaner/ReplicationZKLockCleanerChore.java      | 4 +++-
 .../hadoop/hbase/replication/master/ReplicationLogCleaner.java   | 2 +-
 .../hbase/replication/regionserver/DumpReplicationQueues.java    | 3 +++
 .../hbase/replication/regionserver/ReplicationSourceManager.java | 2 +-
 .../org/apache/hadoop/hbase/util/hbck/ReplicationChecker.java    | 3 +++
 6 files changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/2b60f4ec/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 89a531a..636aebd 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
@@ -570,6 +570,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/2b60f4ec/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/2b60f4ec/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/2b60f4ec/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 bf38d6f..b086cdb 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
@@ -262,6 +262,9 @@ public class DumpReplicationQueues extends Configured implements Tool
{
     Set<String> peerIds = new HashSet<String>(replicationPeers.getAllPeerIds());
     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);

http://git-wip-us.apache.org/repos/asf/hbase/blob/2b60f4ec/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 68f663a..c99d15c 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
@@ -241,7 +241,7 @@ public class ReplicationSourceManager implements ReplicationListener {
       }
     }
     List<String> currentReplicators = this.replicationQueues.getListOfReplicators();
-    if (currentReplicators == null || currentReplicators.size() == 0) {
+    if (currentReplicators == null || currentReplicators.isEmpty()) {
       return;
     }
     List<String> otherRegionServers = replicationTracker.getListOfRegionServers();

http://git-wip-us.apache.org/repos/asf/hbase/blob/2b60f4ec/hbase-server/src/main/java/org/apache/hadoop/hbase/util/hbck/ReplicationChecker.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/hbck/ReplicationChecker.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/hbck/ReplicationChecker.java
index 64212c9..bf29fee 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/hbck/ReplicationChecker.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/hbck/ReplicationChecker.java
@@ -94,6 +94,9 @@ public class ReplicationChecker {
     Set<String> peerIds = new HashSet<String>(this.replicationPeers.getAllPeerIds());
     try {
       List<String> replicators = this.queuesClient.getListOfReplicators();
+      if (replicators == null || replicators.isEmpty()) {
+        return;
+      }
       for (String replicator : replicators) {
         List<String> queueIds = this.queuesClient.getAllQueues(replicator);
         for (String queueId : queueIds) {


Mime
View raw message