HBASE-21749 RS UI may throw NPE and make rs-status page inaccessible with multiwal and replication

Signed-off-by: Andrew Purtell <apurtell@apache.org>
This commit is contained in:
Nihal Jain 2019-01-21 12:50:50 +05:30 committed by Andrew Purtell
parent 35df6147ee
commit f2820ea16f
No known key found for this signature in database
GPG Key ID: 8597754DD5365CCD
1 changed files with 10 additions and 5 deletions

View File

@ -329,11 +329,16 @@ public class ReplicationSource implements ReplicationSourceInterface {
replicationDelay = replicationDelay =
ReplicationLoad.calculateReplicationDelay(ageOfLastShippedOp, lastTimeStamp, queueSize); ReplicationLoad.calculateReplicationDelay(ageOfLastShippedOp, lastTimeStamp, queueSize);
Path currentPath = shipper.getCurrentPath(); Path currentPath = shipper.getCurrentPath();
try { fileSize = -1;
fileSize = getFileSize(currentPath); if (currentPath != null) {
} catch (IOException e) { try {
LOG.warn("Ignore the exception as the file size of HLog only affects the web ui", e); fileSize = getFileSize(currentPath);
fileSize = -1; } 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(); ReplicationStatus.ReplicationStatusBuilder statusBuilder = ReplicationStatus.newBuilder();
statusBuilder.withPeerId(this.getPeerId()) statusBuilder.withPeerId(this.getPeerId())