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:40 UTC
[hbase] branch master 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 master
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/master by this push:
new f2820ea HBASE-21749 RS UI may throw NPE and make rs-status page inaccessible with multiwal and replication
f2820ea is described below
commit f2820ea16fcadc9c3c4d6a8f8e2c42d52223c839
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 10fa50f..f1b6e76 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
@@ -329,11 +329,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())