LemonCL opened a new pull request, #68119:
URL: https://github.com/apache/doris/pull/68119

   …notify_decommissioned
   
   handle_decommission_node and handle_notify_decommissioned flipped a node's 
status by calling ResourceManager::modify_nodes twice in two separate FDB 
transactions: first deleting the node from InstanceInfoPB.nodes[], then 
re-adding it with the new status.
   
   Between the two committed transactions the node is genuinely absent from the 
cluster PB. Any concurrent reader of get_cluster/get_instance (e.g. FE 
CloudClusterChecker polling every 10s) that lands in this window observes a 
phantom node removal: FE drops the backend, re-registers it with a new backend 
id on the next poll, and the tablet rebalancer moves tablets back onto it, 
which can wedge the whole decommission workflow.
   
   Fix: flip the node status in place via a single 
ResourceManager::update_cluster call (read-modify-write of InstanceInfoPB in 
one FDB transaction), the same pattern already used by 
handle_rename_cluster/handle_set_cluster_status etc. The nodes array is never 
shrunk or grown, so readers only ever observe the status before or after the 
flip.
   
   Add MetaServiceTest.DecommissionNodeFlipStatusInPlaceTest to verify the node 
count and node order are preserved across DECOMMISSION_NODE and 
NOTIFY_DECOMMISSIONED.
   
   ### What problem does this PR solve?
   
   Issue Number: close #xxx
   
   Related PR: #xxx
   
   Problem Summary:
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Test <!-- At least one of them must be included. -->
       - [ ] Regression test
       - [ ] Unit Test
       - [ ] Manual test (add detailed scripts or steps below)
       - [ ] No need to test or manual test. Explain why:
           - [ ] This is a refactor/code format and no logic has been changed.
           - [ ] Previous test can cover this change.
           - [ ] No code files have been changed.
           - [ ] Other reason <!-- Add your reason?  -->
   
   - Behavior changed:
       - [ ] No.
       - [ ] Yes. <!-- Explain the behavior change -->
   
   - Does this need documentation?
       - [ ] No.
       - [ ] Yes. <!-- Add document PR link here. eg: 
https://github.com/apache/doris-website/pull/1214 -->
   
   ### Check List (For Reviewer who merge this PR)
   
   - [ ] Confirm the release note
   - [ ] Confirm test cases
   - [ ] Confirm document
   - [ ] Add branch pick label <!-- Add branch pick label that this PR should 
merge into -->
   
   


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to