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

   https://issues.apache.org/jira/browse/HBASE-30463
   
   Since 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 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 hbase-2.6
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   The JIRA lists only master as the component and has no fix versions yet. 
Committers usually want the master PR first and backport from there. The change 
applies to master unchanged, so you could open it against master instead and 
note that it cherry-picks cleanly onto branch-2.6.


-- 
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