Garbage Collector need to remove subdirs of storage/shares when deleting shares #1194

Open
opened 2010-09-06 22:22:09 +00:00 by freestorm · 1 comment
freestorm commented 2010-09-06 22:22:09 +00:00
Owner

As discussed with Warner on IRC,

When GC deletes shares on the grid, it doesn't remove prefixdir and storageindex-dir.

The munin plugin tahoe_files counts storageindex-dir to know how many files are on the Grid.

The count is not correct because empty subdirs are present on storage/shares/.

As discussed with Warner on IRC, When GC deletes shares on the grid, it doesn't remove *prefixdir* and *storageindex-dir*. The munin plugin [tahoe_files](http://tahoe-lafs.org/trac/tahoe-lafs/browser/trunk/misc/operations_helpers/munin/tahoe_files) counts *storageindex-dir* to know how many files are on the Grid. The count is not correct because empty subdirs are present on `storage/shares/`.
tahoe-lafs added the
unknown
minor
defect
1.8β
labels 2010-09-06 22:22:09 +00:00
tahoe-lafs added this to the undecided milestone 2010-09-06 22:22:09 +00:00
warner commented 2010-09-06 22:41:40 +00:00
Author
Owner

In particular, when a share lives in BASEDIR/storage/shares/PREFIXDIR/SIDIR/SHNUM (e.g. node-1/storage/shares/d5/d5j2wyxwvrwiftiwvujhozu67i/3), if we delete the last share in the SIDIR, then we should also delete the SIDIR (but leave the PREFIXDIR), e.g. leave node-1/storage/shares/d5 but delete everything below that.

This requires code in allmydata.storage.immutable.ShareFile.unlink and allmydata.storage.mutable.MutableShareFile.unlink to look in the parent directory, see if it's empty, and if so unlink the parent.

In particular, when a share lives in `BASEDIR/storage/shares/PREFIXDIR/SIDIR/SHNUM` (e.g. `node-1/storage/shares/d5/d5j2wyxwvrwiftiwvujhozu67i/3`), if we delete the last share in the SIDIR, then we should also delete the SIDIR (but leave the PREFIXDIR), e.g. leave `node-1/storage/shares/d5` but delete everything below that. This requires code in `allmydata.storage.immutable.ShareFile.unlink` and `allmydata.storage.mutable.MutableShareFile.unlink` to look in the parent directory, see if it's empty, and if so unlink the parent.
tahoe-lafs added
code-storage
and removed
unknown
labels 2010-09-06 22:41:40 +00:00
tahoe-lafs added
normal
and removed
minor
labels 2012-04-01 05:09:29 +00:00
tahoe-lafs modified the milestone from undecided to eventually 2012-04-01 05:09:29 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: tahoe-lafs/trac-2024-07-25#1194
No description provided.