Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SaunaFS Client, option for returning nearest quota for stat #89

Open
LukasK32 opened this issue May 21, 2024 · 0 comments
Open

SaunaFS Client, option for returning nearest quota for stat #89

LukasK32 opened this issue May 21, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@LukasK32
Copy link

Description

Currently stat command (and similar) always(?) returns raw capacity of the SaunaFS cluster:

$ stat -f .
  File: "."
    ID: 0        Namelen: 255     Type: fuseblk
Block size: 65536      Fundamental block size: 65536
Blocks: Total: 706825     Free: 657670     Available: 657670
Inodes: Total: 4294967279 Free: 4294967275

$ df -h .
Filesystem      Size  Used Avail Use% Mounted on
sfsmaster:9421   44G  3.1G   41G   7% /mnt/saunafs

We use quotas to partition the cluster for multiple applications and we would like them to be able to see only capacity available for them. This is especially useful for applications that discard or compress older data when running low on capacity.

Sample scenario

Prepare sample structure:

$ mkdir -p ./app1 ./app2/nested
$ saunafs setquota -d 0 1G 0 0 ./app1
$ saunafs setquota -d 0 2G 0 0 ./app2
$ head -c 100M /dev/random > ./app1/app1_file
$ head -c 100M /dev/random > ./app2/app2_file
$ head -c 100M /dev/random > ./app2/nested/app2_nested_file

Now running stat -f for directory

  • ./app1 - should return equivalent of 1[GB] for Blocks Total and equivalent of 900[MB] for Blocks Free,
  • ./app2 and ./app2/nested - should return equivalent of 2[GB] for Blocks Total and equivalent of 1800[MB] for Blocks Free.

Proposal

This could be achieved as an option for SaunaFS Client (e.g. -o sfsstatmode=hardquota) that changes that behavior to return size and usage of the hierarchically nearest quota, and raw capacity if no quota is found in the tree.

@uristdwarf uristdwarf added enhancement New feature or request good first issue Good for newcomers labels May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants