neuyilan opened a new issue, #25744:
URL: https://github.com/apache/doris/issues/25744

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Version
   
   2.0.2
   
   ### What's Wrong?
   
   The reasons are as follows:
   
   Clone process
   
   Assume that node B clones the data on node A. A. B nodes are all BE nodes;
   
   1. Fe initiates the clone task; Generate metadata for a new node's tablet 
replica in memory; At this point, the tablet state is CLONE.
   
   
   2. Fe will issue clone tasks to node B;
   
   3. Node B will execute the clone task, and when the execution is completed, 
the tablet will be added to the local tablet list. Finally, the task will be 
reported to FE to success.
   
   
   4. The FE node will modify the status of this tablet to NORMAL;
   
   
   
   Reporting process
   
   The problem lies in the fact that BE will regularly (5 seconds) report the 
status of the tablet on the node it belongs to.
   
   
   
   BE will regularly report local tablets to FE. At this time, the report 
thread on FE will receive the tables reported by this node and compare them 
with the tablets in FE's memory.
   
   
   When it is found that there is a tablet in FE but not in BE, the metadata of 
the tablet on FE will be deleted. Although fe has taken into account the CLONE 
tablet, that is, if the metadata state of the tablet on fe is not NORMAL, then 
the logic will not be deleted. That is the comment below.
   
   
![image](https://github.com/apache/doris/assets/6237070/ea4c9741-f3f7-4ca7-9a2e-4807a95ee25f)
   
   However, the problem lies here, as modifying the metadata of the tablet is 
not an atomic operation. That is to say, at this point, BE may have just 
reported the status to FE, who has changed the status of this tablet to normal 
(by calling finishCloneTask()). 
   
   
![image](https://github.com/apache/doris/assets/6237070/5357d6fd-b3d0-4c43-b463-4769a63efe1c)
   
   After deleting this tablet from the FE metadata, the next BE report will 
report this tablet, but FE no longer has this tablet, but BE will still report 
it. So we will go to the code below. So this tablet will eventually be deleted.
   
   
   
![image](https://github.com/apache/doris/assets/6237070/4666c574-9dd3-4d44-bba0-8e994760459e)
   
   ### What You Expected?
   
   fix the bug
   
   ### How to Reproduce?
   
   _No response_
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


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