-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
Search before asking
- I had searched in the issues 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;
-
Fe initiates the clone task; Generate metadata for a new node's tablet replica in memory; At this point, the tablet state is CLONE.
-
Fe will issue clone tasks to node B;
-
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.
-
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.
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()).
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.
What You Expected?
fix the bug
How to Reproduce?
No response
Anything Else?
No response
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct


