What happened:
We use Ceph 16.2.x RADOS as backend storage and use PostgreSQL 17 as metadata storage. After many operation of rsync/juicefs sync, "df" is showing much larger space usage(263GB) than its real use in both RADOS pool(29GB) and "du -sh " on juicefs. Seems "df" used space is reported from jfs_counter.usedSpace. I've tried all the command available in juicefs, eg gc/fsck/compact but none of them help to fix it. Seems there is not providing a function to recalculate jfs_counter.usedSpace from underlying metadata , if there is any available function to do so , please let me know. Thanks
[root@vbakjob05 jfs]# df -h
Filesystem Size Used Avail Use% Mounted on
JuiceFS:myjfs 2.0P 263G 2.0P 1% /jfs
[root@ceph1 ~]# ceph df|grep jfs
--- POOLS ---
POOL ID PGS STORED OBJECTS USED %USED MAX AVAIL
jfs 59 32 29 GiB 57.34k 85 GiB 0.02 119 TiB
What happened: We use Ceph 16.2.x RADOS as backend storage and use PostgreSQL 17 as metadata storage. After many operation of rsync/juicefs sync, "df" is showing much larger space usage(263GB) than its real use in both RADOS pool(29GB) and "du -sh " on juicefs. Seems "df" used space is reported from jfs_counter.usedSpace. I've tried all the command available in juicefs, eg gc/fsck/compact but none of them help to fix it. Seems there is not providing a function to recalculate jfs_counter.usedSpace from underlying metadata , if there is any available function to do so , please let me know. Thanks
[root@vbakjob05 jfs]# df -h Filesystem Size Used Avail Use% Mounted on JuiceFS:myjfs 2.0P 263G 2.0P 1% /jfs
[root@ceph1 ~]# ceph df|grep jfs --- POOLS --- POOL ID PGS STORED OBJECTS USED %USED MAX AVAIL jfs 59 32 29 GiB 57.34k 85 GiB 0.02 119 TiB
[root@vbakjob05 jfs]# du -sh 29G .
postgresql metadata
jfs=# select * from jfs_counter; name | value
---------------------+-------------- nextTrash | 7 nextSession | 32 nextInode | 507906 lastCleanupFiles | 1727581443 nextCleanupSlices | 1727581457 lastCleanupSessions | 1727581492 nextChunk | 475137 lastCleanupTrash | 1727578016 usedSpace | 281507139584 totalInodes | 251264 (10 rows)
Environment:
juicefs --version
) or Hadoop Java SDK version: juicefs version 1.2.1+2024-08-30.cd871d19ba57 (compiled with juicefs.ceph)cat /etc/os-release
):Rocky Linux release 8.8 (Green Obsidian)uname -a
):4.18.0-477.27.1.el8_8.x86_64 #1 SMP Wed Sep 20 15:55:39 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux