craffit opened a new pull request, #8765:
URL: https://github.com/apache/hbase/pull/8765

   https://issues.apache.org/jira/browse/HBASE-30463
   
   Since [HBASE-28158](https://issues.apache.org/jira/browse/HBASE-28158), 
HMaster#finishActiveMasterInitialization collects the unfinished
   ServerCrashProcedures with 
Collectors.toMap(ServerCrashProcedure::getServerName, 
Procedure::getSubmittedTime) and no merge function. If the procedure store 
holds two
   unfinished SCPs for the same ServerName, the collector throws
   IllegalStateException: Duplicate key ... and the master aborts. It aborts 
again on
   every restart, because the same store is reloaded. Before 
[HBASE-28158](https://issues.apache.org/jira/browse/HBASE-28158) these 
procedures
   were collected into a Set, which tolerated duplicates.
   
   Duplicate SCPs can be persisted because the submission guards rely on 
in-memory
   DeadServer state. DeadServer#cleanPreviousInstance removes the old server 
name while
   its SCP is still running, as soon as a new instance on the same host and 
port reports in.
   
   The fix adds Math::min as the merge function. That keeps the earliest submit 
time as
   the crash time, matching DeadServer#putIfAbsent. Both SCPs are still loaded 
and run
   one after the other, because they take the same exclusive server lock.
   
   TestMasterStartupWithDuplicateSCPs holds the server lock so that two SCPs 
for the same
   server stay unfinished in the store. It then restarts the master and 
verifies that the
   master initializes and both procedures complete.
   
   Affects 2.5.14+, 2.6.5+, 2.7.0 and 3.0.0. This patch is on master
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to