HBASE-24713 RS startup with FSHLog throws NPE after HBASE-21751

writer null check if not initialized yet during syncrunner run (#2201)

Signed-off-by: Ramkrishna <ramkrishna@apache.org>
Signed-off-by: Viraj Jasani <vjasani@apache.org>
Signed-off-by: AnoopSamJohn<anoopsamjohn@apache.org>
(cherry picked from commit b0863c5832)
This commit is contained in:
gkanade 2020-08-05 18:44:12 +05:30 committed by Sean Busbey
parent ec39d59161
commit bfa558a0e3
1 changed files with 1 additions and 1 deletions

View File

@ -329,7 +329,7 @@ public class FSHLog extends AbstractFSWAL<Writer> {
SyncFuture syncFuture = null;
SafePointZigZagLatch zigzagLatch = null;
long sequence = -1L;
if (this.ringBufferEventHandler != null) {
if (this.writer != null && this.ringBufferEventHandler != null) {
// Get sequence first to avoid dead lock when ring buffer is full
// Considering below sequence
// 1. replaceWriter is called and zigzagLatch is initialized