This is an automated email from the ASF dual-hosted git repository.
apurtell pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2.1 by this push:
new 76df1c1 HBASE-21749 RS UI may throw NPE and make rs-status page
inaccessible with multiwal and replication
76df1c1 is described below
commit 76df1c159018e60801eb11b083243fb6069a8fa0
Author: Nihal Jain <[email protected]>
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 <[email protected]>
---
.../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())