[
https://issues.apache.org/jira/browse/HBASE-30463?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Bram Schuur updated HBASE-30463:
--------------------------------
Description:
Since HBASE-28158, HMaster.finishActiveMasterInitialization collects unfinished
SCPs with Collectors.toMap(ServerCrashProcedure::getServerName,
Procedure::getSubmittedTime) with no merge function. If the procedure store
holds two unfinished SCPs for the same ServerName, the collector throws
IllegalStateException: Duplicate key. The master aborts on every restart and
can't recover without manual store surgery. The previous code collected into a
Set and tolerated this. Duplicate SCPs are possible because the in-memory
guards depend on DeadServer, which cleanPreviousInstance clears when a server
restarts on the same host and port while its SCP is still running. Fix: merge
duplicates with Long::min, matching DeadServer.putIfAbsent's keep-first
behaviour. Both procedures can then run; they serialize on the server's
exclusive lock.
Co-Authored by Claude Code
was:Since HBASE-28158, HMaster.finishActiveMasterInitialization collects
unfinished SCPs with Collectors.toMap(ServerCrashProcedure::getServerName,
Procedure::getSubmittedTime) with no merge function. If the procedure store
holds two unfinished SCPs for the same ServerName, the collector throws
IllegalStateException: Duplicate key. The master aborts on every restart and
can't recover without manual store surgery. The previous code collected into a
Set and tolerated this. Duplicate SCPs are possible because the in-memory
guards depend on DeadServer, which cleanPreviousInstance clears when a server
restarts on the same host and port while its SCP is still running. Fix: merge
duplicates with Long::min, matching DeadServer.putIfAbsent's keep-first
behaviour. Both procedures can then run; they serialize on the server's
exclusive lock.
> HMaster fails to initialize when the procedure store contains more than one
> ServerCrashProcedure for the same server
> ---------------------------------------------------------------------------------------------------------------------
>
> Key: HBASE-30463
> URL: https://issues.apache.org/jira/browse/HBASE-30463
> Project: HBase
> Issue Type: Bug
> Components: master
> Affects Versions: 3.0.0, 2.7.0, 2.6.5, 2.5.14
> Reporter: Bram Schuur
> Priority: Major
>
> Since HBASE-28158, HMaster.finishActiveMasterInitialization collects
> unfinished SCPs with Collectors.toMap(ServerCrashProcedure::getServerName,
> Procedure::getSubmittedTime) with no merge function. If the procedure store
> holds two unfinished SCPs for the same ServerName, the collector throws
> IllegalStateException: Duplicate key. The master aborts on every restart and
> can't recover without manual store surgery. The previous code collected into
> a Set and tolerated this. Duplicate SCPs are possible because the in-memory
> guards depend on DeadServer, which cleanPreviousInstance clears when a server
> restarts on the same host and port while its SCP is still running. Fix: merge
> duplicates with Long::min, matching DeadServer.putIfAbsent's keep-first
> behaviour. Both procedures can then run; they serialize on the server's
> exclusive lock.
> Co-Authored by Claude Code
--
This message was sent by Atlassian Jira
(v8.20.10#820010)