The invention discloses a method for flexibly recovering and cleaning a distributed recycle bin, which relates to the field of distributed
file storage recycle bins and is characterized in that in a distributed
file storage system, a key value storage mode is adopted, specifically, through a rocksdb
database, flexible
recovery and cleaning after
file deletion are realized, and when the file is deleted, the file can be flexibly recovered and cleaned.
Metadata information and filename information of a file are stored in a rocksdb
database of a current
metadata node in a key-value pair mode, and an index is established according to a certain rule. Aiming at the characteristics of a distributed
file storage system, the method can uniformly manage deleted files in a cross-node manner, the security and restorability of data in a complex environment are ensured, a user can recover mistakenly deleted files from a recycle bin within a certain time, the
data loss risk is reduced, and the user experience is improved. The
metadata information and the filename information of the file are stored in the high-performance rocksdb
database in the form of the key-value pair, and the index is established, so that the overhead of moving the file across nodes is avoided, and the
processing speed and efficiency of the recycle bin are greatly improved.