-
Notifications
You must be signed in to change notification settings - Fork 527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
delete partition after fail #2788
base: master
Are you sure you want to change the base?
Conversation
@@ -222,6 +222,28 @@ void TopoUpdater::UpdatePartitionTopo( | |||
LOG(WARNING) << "hearbeat report partition which is not in topo" | |||
<< ", copysetId = " << copySetId | |||
<< ", partitionId = " << it.GetPartitionId(); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not a good idea to delete here. If you really want to do it, you'd better check inode and dentry numbers of this partition again and make sure it is empty.
This piece of code logic can directly call TopologyManager::DeletePartition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that the logic in TopologyManager::DeletePartitio first fetches the corresponding partition from topology_. The situation we are facing now is that there is no corresponding partition in topology_.So, I added the DeleteAbnormalPartition function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failure to create is just one of the cases where the partition exists in metaserver but not in mds, so to be on the safe side, it is best to check whether the partition is empty first.
You can split the original TopologyManager::DeletePartitio into a function, such as TopologyManager::DeletePartitionDirectly, which does not check whether it exists in mds, so TopologyManager::DeletePartitionDirectly can be reused by you and the original code at the same time, and you can There is no need to rewrite the sending logic again.
Signed-off-by: Yan Chao Mei <[email protected]>
pls fix |
@yanchaomei Comlete it as soon as possible if have time. |
get it |
What problem does this PR solve?
Problem Summary:
When the partition is successfully created on the metaserver, but fails to persist in the topology, we should go to the metaserver to delete the partition
What is changed and how it works?
What's Changed:
How it Works:
Side effects(Breaking backward compatibility? Performance regression?):
Check List