You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ap...@apache.org on 2019/01/22 02:00:38 UTC
[hbase] branch branch-2 updated: HBASE-21749 RS UI may throw NPE
and make rs-status page inaccessible with multiwal and replication
This is an automated email from the ASF dual-hosted git repository.
apurtell pushed a commit to branch branch-2
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2 by this push:
new 5b99a34 HBASE-21749 RS UI may throw NPE and make rs-status page inaccessible with multiwal and replication
5b99a34 is described below
commit 5b99a34a31df398085b42629c42053a2a55d1ce7
Author: Nihal Jain <ni...@gmail.com>
AuthorDate: Mon Jan 21 12:50:50 2019 +0530
HBASE-21749 RS UI may throw NPE and make rs-status page inaccessible with multiwal and replication
Signed-off-by: Andrew Purtell <ap...@apache.org>
---
.../hbase/replication/regionserver/ReplicationSource.java | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
index 04a54e0..8dd8568 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
@@ -325,11 +325,16 @@ public class ReplicationSource implements ReplicationSourceInterface {
replicationDelay =
ReplicationLoad.calculateReplicationDelay(ageOfLastShippedOp, lastTimeStamp, queueSize);
Path currentPath = shipper.getCurrentPath();
- try {
- fileSize = getFileSize(currentPath);
- } catch (IOException e) {
- LOG.warn("Ignore the exception as the file size of HLog only affects the web ui", e);
- fileSize = -1;
+ fileSize = -1;
+ if (currentPath != null) {
+ try {
+ fileSize = getFileSize(currentPath);
+ } catch (IOException e) {
+ LOG.warn("Ignore the exception as the file size of HLog only affects the web ui", e);
+ }
+ } else {
+ currentPath = new Path("NO_LOGS_IN_QUEUE");
+ LOG.warn("No replication ongoing, waiting for new log");
}
ReplicationStatus.ReplicationStatusBuilder statusBuilder = ReplicationStatus.newBuilder();
statusBuilder.withPeerId(this.getPeerId())