[ https://issues.apache.org/jira/browse/HBASE-27984?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17745093#comment-17745093 ]
Duo Zhang commented on HBASE-27984: ----------------------------------- ReplicationLogCleanerBarrier is just a simple data structure, so I think we could put it in HMaster directly and create it at the very beginning, so there is no problem to call its method in afterReplay. Let me provide a patch and you can see if it is OK. Thanks. > NPE in MigrateReplicationQueueFromZkToTableProcedure recovery > ------------------------------------------------------------- > > Key: HBASE-27984 > URL: https://issues.apache.org/jira/browse/HBASE-27984 > Project: HBase > Issue Type: Bug > Components: Replication > Affects Versions: 3.0.0-alpha-4 > Reporter: ruanhui > Priority: Trivial > Fix For: 4.0.0-alpha-1 > > > MigrateReplicationQueueFromZkToTableProcedure will restore the disabled state > of replication log cleaner barrier when replayed in master recovery, > {code:java} > @Override > protected void afterReplay(MasterProcedureEnv env) { > if (getCurrentState() == getInitialState()) { > // do not need to disable log cleaner or acquire lock if we are in the > initial state, later > // when executing the procedure we will try to disable and acquire. > return; > } > if > (!env.getReplicationPeerManager().getReplicationLogCleanerBarrier().disable()) > { > throw new IllegalStateException("can not disable log cleaner, this should > not happen"); > } > } {code} > however the replicationPeerManager has not been initialized when replay > procedure, which will cause a nullPointerException and master to abort. > Maybe better to add a check after the initialization of > replicationPeerManager to determine whether replication log cleaner barrier > needs to be disabled ? -- This message was sent by Atlassian Jira (v8.20.10#820010)