Garage reports wrong disk available size when run in systemd with DynamicUser=True #611
Labels
No Label
AdminAPI
Bug
Check AWS
CI
Correctness
Critical
Documentation
Ideas
Improvement
Low priority
Newcomer
Performance
S3 Compatibility
Testing
Usability
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Deuxfleurs/garage#611
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug
In this example, Garage reports 213GB instead of 2.6TB.
The daemon is started by Systemd with
DynamicUser=True
set.Diagnostic
Garage uses the systemstat crate to fetch available space on a disk: https://github.com/valpackett/systemstat
And calls its mount() function: https://git.deuxfleurs.fr/Deuxfleurs/garage/src/branch/main/src/rpc/system.rs#L894-L895
Then find the longest mount point that matches the beginning of the meta/data folders.
I think the mount points are not rewritten/scoped in systemd: if garage sees the /var/lib/garage/data folder, when it lists the mount points, it gets /var/lib/private/garage/data.
Possible solution
(quoting Linux Hackerman on Garage Matrix channel) ah yeah that seems wrong
it should probably statfs the data dir. I don't know what the portability requirements are on garage, but https://docs.rs/nix/latest/nix/sys/statvfs/index.html looks appropriate in principle