mar-file-system / marfs

MarFS provides a scalable near-POSIX file system by using one or more POSIX file systems as a scalable metadata component and one or more data stores (object, file, etc) as a scalable data component.
Other
96 stars 27 forks source link

Garbage Collection Implementation of marfs_restart xattr MDFS trash pathname #123

Closed atorrez closed 8 years ago

atorrez commented 8 years ago

Refer to close issue #85. Garbage Collection needs the following updates:

so GC must do the following:

if a file in trash is complete (doesn't have RESTART) and has post.obj_type=Multi, then just iterate for post.chunks, generating chunk object-IDs, and deleting those objects. Then use post.mdfs to find the trash path, and generate the *.path companion pathname, and delete those two files.

If a file in the trash has RESTART and (pre.obj_type==OBJ_FUSE), then it's a Multi file created from fuse, and fuse crashed before closing. This of course never actually happens, but, if it did, the trashing procedure will have generated a POST, with correct post.chunks and post.chunk_info_bytes. Handle it like a completed Multi-file (see above).

If a file in the trash has RESTART and (pre.obj_type==OBJ_Nto1), then it's an incomplete Multi file created from pftool. Use read_chunkinfo() to crawl chunks, but some of them may be empty. These can be identified by having config_vers_maj == 0. For non-empty chunks, generate object-IDs and delete. There should be at most post.chunks of them, but almost-certainly less than that.

atorrez commented 8 years ago

Code implemented and tested. Additional testing to continue