CPC G06F 16/162 (2019.01) [G06F 16/134 (2019.01); G06F 16/148 (2019.01); G06F 16/182 (2019.01)] | 5 Claims |
1. A method for deleting a file in a distributed system, characterized by comprising:
querying whether an incomplete file deletion operation exists under a sub-tree root corresponding to a certain metadata server (MDS);
continuing to delete data under the sub-tree root corresponding to the MDS if there is an incomplete file deletion operation, and determining whether the sub-tree root is a copy; and
deleting the sub-tree root copy in a memory of the MDS if the sub-tree root is a copy;
creating a timed deleting task in the distributed system if there is no incomplete file deletion operation; and
balancing the number of sub-tree roots to be deleted among different MDSs according to the created timed deleting task;
wherein the step of balancing the number of sub-tree roots to be deleted among different MDSs according to the created timed deleting task specifically comprises:
acquiring and recording the number of sub-tree roots to be deleted with the timed deleting task on each MDS; and
calculating an average value of the number of sub-tree roots to be deleted on all MDSs; and
migrating sub-tree roots to be deleted to the MDSs having a number of sub-tree roots to be deleted lower than the average value sequentially from the MDS having the largest number of sub-tree roots to be deleted, until no MDS having a number of sub-tree roots to be deleted less than the average value exists.
|