Skip to content

quota: The quota is not reclaimed after deleting data #6729

@YunhuiChen

Description

@YunhuiChen

What happened:

root@chaos-k8s-001:~/chenyunhui/juicefs# ./juicefs quota set redis://127.0.0.1:6379/1 --uid 2001 --capacity 1 --inodes 5
2026/03/11 15:16:35.640359 juicefs[4049647] <INFO>: Meta address: redis://127.0.0.1:6379/1 [NewClient@interface.go:627]
2026/03/11 15:16:35.640793 juicefs[4049647] <WARNING>: AOF is not enabled, you may lose data if Redis is not shutdown properly. [checkRedisInfo@info.go:84]
2026/03/11 15:16:35.640850 juicefs[4049647] <INFO>: Ping redis latency: 20.67µs [checkServerConfig@redis.go:4304]
+----------+---------+------+------+--------+-------+-------+
|  User ID |   Size  | Used | Use% | Inodes | IUsed | IUse% |
+----------+---------+------+------+--------+-------+-------+
| UID:2001 | 1.0 GiB |  0 B |   0% |      5 |     0 |    0% |
+----------+---------+------+------+--------+-------+-------+

root@chaos-k8s-001:~/chenyunhui/juicefs# dd if=/dev/zero of=/juicefs2/2001 bs=1G count=1
1+0 records in
1+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 4.98064 s, 216 MB/s

root@chaos-k8s-001:~/chenyunhui/juicefs# chown 2001:2001 /juicefs2/2001

root@chaos-k8s-001:~/chenyunhui/juicefs# ./juicefs quota list redis://127.0.0.1:6379/1
2026/03/11 15:17:42.176569 juicefs[4050141] <INFO>: Meta address: redis://127.0.0.1:6379/1 [NewClient@interface.go:627]
2026/03/11 15:17:42.176993 juicefs[4050141] <WARNING>: AOF is not enabled, you may lose data if Redis is not shutdown properly. [checkRedisInfo@info.go:84]
2026/03/11 15:17:42.177067 juicefs[4050141] <INFO>: Ping redis latency: 43.77µs [checkServerConfig@redis.go:4304]
2026/03/11 15:17:42.177574 juicefs[4050141] <WARNING>: Used inodes of uid:1000 is negative (-330), please run `juicefs quota check` to fix it [quota@quota.go:232]
2026/03/11 15:17:42.177592 juicefs[4050141] <WARNING>: Used inodes of uid:1001 is negative (-11), please run `juicefs quota check` to fix it [quota@quota.go:232]
2026/03/11 15:17:42.177603 juicefs[4050141] <WARNING>: Used inodes of uid:1002 is negative (-209), please run `juicefs quota check` to fix it [quota@quota.go:232]
+----------+---------+---------+------+-----------+-------+-------+
|   Path   |   Size  |   Used  | Use% |   Inodes  | IUsed | IUse% |
+----------+---------+---------+------+-----------+-------+-------+
| /ttt     | 1.0 GiB |     0 B |   0% | unchanged |     0 |       |
| UID:1000 | 1.0 GiB | 1.9 GiB | 194% |         5 |     0 |    0% |
| UID:1001 | 1.0 GiB | 1.6 MiB |   0% |         5 |     0 |    0% |
| UID:1002 | 1.0 GiB | 592 KiB |   0% |         5 |     0 |    0% |
| UID:2000 | 1.0 GiB | 4.0 KiB |   0% |         5 |     0 |    0% |
| UID:2001 | 1.0 GiB | 1.0 GiB | 100% |         5 |     1 |   20% |
+----------+---------+---------+------+-----------+-------+-------+

root@chaos-k8s-001:~/chenyunhui/juicefs# rm /juicefs2/2001
root@chaos-k8s-001:~/chenyunhui/juicefs# ./juicefs quota list redis://127.0.0.1:6379/1
2026/03/11 15:17:58.943517 juicefs[4050238] <INFO>: Meta address: redis://127.0.0.1:6379/1 [NewClient@interface.go:627]
2026/03/11 15:17:58.943960 juicefs[4050238] <WARNING>: AOF is not enabled, you may lose data if Redis is not shutdown properly. [checkRedisInfo@info.go:84]
2026/03/11 15:17:58.944030 juicefs[4050238] <INFO>: Ping redis latency: 20.1µs [checkServerConfig@redis.go:4304]
2026/03/11 15:17:58.944499 juicefs[4050238] <WARNING>: Used inodes of uid:1000 is negative (-330), please run `juicefs quota check` to fix it [quota@quota.go:232]
2026/03/11 15:17:58.944515 juicefs[4050238] <WARNING>: Used inodes of uid:1001 is negative (-11), please run `juicefs quota check` to fix it [quota@quota.go:232]
2026/03/11 15:17:58.944525 juicefs[4050238] <WARNING>: Used inodes of uid:1002 is negative (-209), please run `juicefs quota check` to fix it [quota@quota.go:232]
+----------+---------+---------+------+-----------+-------+-------+
|   Path   |   Size  |   Used  | Use% |   Inodes  | IUsed | IUse% |
+----------+---------+---------+------+-----------+-------+-------+
| /ttt     | 1.0 GiB |     0 B |   0% | unchanged |     0 |       |
| UID:1000 | 1.0 GiB | 1.9 GiB | 194% |         5 |     0 |    0% |
| UID:1001 | 1.0 GiB | 1.6 MiB |   0% |         5 |     0 |    0% |
| UID:1002 | 1.0 GiB | 592 KiB |   0% |         5 |     0 |    0% |
| UID:2000 | 1.0 GiB | 4.0 KiB |   0% |         5 |     0 |    0% |
| UID:2001 | 1.0 GiB | 1.0 GiB | 100% |         5 |     0 |    0% |
+----------+---------+---------+------+-----------+-------+-------+

What you expected to happen:

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?

Environment:

  • JuiceFS version (use juicefs --version) or Hadoop Java SDK version:
  • Cloud provider or hardware configuration running JuiceFS:
  • OS (e.g cat /etc/os-release):
  • Kernel (e.g. uname -a):
  • Object storage (cloud provider and region, or self maintained):
  • Metadata engine info (version, cloud provider managed or self maintained):
  • Network connectivity (JuiceFS to metadata engine, JuiceFS to object storage):
  • Others:

Metadata

Metadata

Labels

kind/bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions