Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Hey all, some time ago I was complaining about a vast discrepancy of pool space reported used by datasets (about 500Gb) and just used on pool (over 700Gb) leaving me with little head space to actually work in (and at least once crashing when it all ran out... habit of keeping a dummy reservation dataset to quickly destroy saved that day).
- One my theory connected this to znapzend that regularly created source snapshots but did not always have where to send them, and/or znapzend did not always succeed the whole sending operation so it either way skipped the cleanup.
- [2020-11-18 05:29:28.63135] [4106] [debug] cleaning up 3365 source snapshots recursively under nvpool/zones
- ugh!
- after some fixes to the script in the past months, I got it to pass as far as proper cleanup, and got back 50Gb already, and counting...
- so now the question is: how do zfs tools account space used by metadata of snapshots? My guess is that this could be what ate my disks...
- (UPDATE)
- at least, after znapzend took 1280 mins to sent meagre updates and clean up the mostly empty snapshots (on NVMe!) I have over 100Gb added to usable disk space
- (UPDATE)
- After the fixed znapzend cleaned up another dataset tree (with unknown amount of snaps - `zfs list -tsnapshot | wc -l` failed many times with "out of memory", sometime closer to end of adventure there were 185K snaps left there), another 100G surfaced, and so most of the unexplained discrepancy is gone. Indirect blocks or whatever else is involved in snapshots and not currently accounted as some dataset size metric, do take nontrivial space and add up considerably en-masse.
- With cleanups of nvpool/ROOT and nvpool/zones behind (about 30 older inactive BEs are around, with about 7 datasets per rootfs, adding up for each existing recursive snapshot - overall ranging 300-500 policied snaps under each rootfs tree), and nvpool/export tree ongoing, the numbers are:
- # zfs list -tfilesystem -d1 -o name -r nvpool | grep / | while read Z ; do printf '%25s\t%s\n' "$Z" "`zfs list -t snapshot -r $Z | wc -l`" ; done
- nvpool/Media 67
- nvpool/ROOT 11125
- nvpool/SHARED 5076
- nvpool/SHARED-nobackup 3
- nvpool/export 22511
- nvpool/kohsuke 28
- nvpool/temp 5
- nvpool/test 20
- nvpool/tmp 4
- nvpool/var-squid-cache 1
- nvpool/zones 14404
- root@jimoi:/root# zfs list -d1 -ospace -sused -r nvpool
- NAME AVAIL USED USEDSNAP USEDDS USEDREFRESERV USEDCHILD
- nvpool/tmp 197G 23K 0 23K 0 0
- nvpool/kohsuke 197G 59K 13K 23K 0 23K
- nvpool/test 197G 73K 0 25K 0 48K
- nvpool/temp 197G 668M 0 668M 0 0
- nvpool/dump 197G 1.00G 0 1.00G 0 0
- nvpool/SHARED-nobackup 197G 1.38G 0 24K 0 1.38G
- nvpool/var-squid-cache 197G 3.36G 0 3.36G 0 0
- nvpool/swap 198G 8.50G 0 8.01G 501M 0
- nvpool/zones 197G 9.42G 0 23K 0 9.42G
- nvpool/SHARED 197G 18.4G 0 23K 0 18.4G
- nvpool/ROOT 197G 87.0G 0 23K 0 87.0G
- nvpool/Media 197G 141G 191M 141G 0 0
- nvpool/export 197G 285G 0 23K 0 285G
- nvpool 197G 563G 14K 36K 0 563G
- root@jimoi:/root# zfs list -d1 -p -ospace -sused -r nvpool
- NAME AVAIL USED USEDSNAP USEDDS USEDREFRESERV USEDCHILD
- nvpool/tmp 211983997904 23552 0 23552 0 0
- nvpool/kohsuke 211983997904 60416 13312 23552 0 23552
- nvpool/test 211983997904 74752 0 25600 0 49152
- nvpool/temp 211983997904 700783616 0 700783616 0 0
- nvpool/dump 211983997904 1073847296 0 1073847296 0 0
- nvpool/SHARED-nobackup 211983997904 1486294528 0 24576 0 1486269952
- nvpool/var-squid-cache 211983997904 3610465792 0 3610465792 0 0
- nvpool/swap 212509190096 9126805504 0 8601613312 525192192 0
- nvpool/zones 211983997904 10115445248 0 23552 0 10115421696
- nvpool/SHARED 211983997904 19763642368 0 23552 0 19763618816
- nvpool/ROOT 211983997904 93384927744 0 23552 0 93384904192
- nvpool/Media 211983997904 151921219072 200092672 151721126400 0 0
- nvpool/export 211983997904 305842327040 0 23552 0 305842303488
- nvpool 211983997904 604379958272 14336 36864 0 604379907072
- root@jimoi:/root# zfs list -d1 -Housed,name -sused -p -r nvpool | grep / | awk '{print $1}' | ( A=0; while read B; do A=$(($A+$B)) ; done ;echo $A )
- 597025938944
- root@jimoi:/root# expr 604379958272 - 597025938944
- 7354019328
- So now they are wonderfully close, with some 7G "unaccounted" used space (and about 50k snaps remaining across nvpool total).
- -----
- Data for original issue discussion:
- root@jimoi:/usr/share/znapzend# zfs list -tall -d1 -s used -r nvpool
- NAME USED AVAIL REFER MOUNTPOINT
- nvpool@20190826-01 0 - 23K -
- nvpool@20190830-01 0 - 23K -
- nvpool@20190910-02 0 - 23K -
- nvpool/tmp 23K 14.8G 23K /nvpool/tmp
- nvpool/kohsuke 59K 14.8G 23K /nvpool/kohsuke
- nvpool/test 73K 14.8G 25K /nvpool/test
- nvpool/SHARED-nobackup 70.8M 14.8G 24K legacy
- nvpool/temp 668M 14.8G 668M /nvpool/temp
- nvpool/dump 1.00G 14.8G 1.00G -
- nvpool/var-squid-cache 7.16G 14.8G 7.16G /var/squid/cache
- nvpool/swap 8.50G 15.3G 8.01G -
- nvpool/zones 9.42G 14.8G 23K /zones
- nvpool/SHARED 18.4G 14.8G 23K legacy
- nvpool/ROOT 89.7G 14.8G 23K legacy
- nvpool/Media 139G 14.8G 138G /Media
- nvpool/export 277G 14.8G 23K /export
- nvpool 744G 14.8G 36K /nvpool
- root@jimoi:/usr/share/znapzend# zpool list nvpool
- NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
- nvpool 744G 704G 39.8G - - 67% 94% 3.40x DEGRADED -
- ### In `zfs list`, the "used" sizes of datasets sum up to about 552Gb,
- ### however the pool has "used" 744Gb and 14.8G "avail".
- ### In `zpool list`, 744G is its *size*, while "alloc" is 704G and "free" is 39.8G.
- ### I gather the difference of "avail" vs "free" is well-known (some is 1/64th of
- ### the pool if that system reservation against fragmentation still exists...
- ### though then how come zfs performance collapses due to fragmentation still?)
- ### and might include blocks reserved but not actually written by certain datasets
- ### like swap, etc.
- ### But "used" zfs being same as "size" of zpool seems like a bug... or maybe not,
- ### if it is essentially the reservation and quota all in one on current backing
- ### storage. Anyhow, those 552G used or reserved by datasets, vs. 704G allocated,
- ### is quite a difference
- ### this is a mirror, or rather single disk that now remains
- ### but metadata enjoys multiple block copies, right?
- ### so back to first question, are metadata blocks of snapshots accounted in parent
- ### datasets, or only in pool directly? And other metadata for that matter?
- ### Here it seems to have cost a quarter of pool size, so I wonder... :)
- # Other clues... dedup table exists...
- root@jimoi:/usr/share/znapzend# zdb -DDD nvpool
- DDT-sha256-zap-duplicate: 64198 entries, size 291 on disk, 141 in core
- bucket allocated referenced
- ______ ______________________________ ______________________________
- refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE
- ------ ------ ----- ----- ----- ------ ----- ----- -----
- 2 26.9K 941M 233M 233M 60.1K 2.47G 552M 552M
- 4 35.1K 815M 255M 255M 142K 3.27G 1.02G 1.02G
- 8 471 6.74M 2.05M 2.05M 4.08K 64.9M 19.9M 19.9M
- 16 198 144K 112K 112K 3.80K 2.71M 2.13M 2.13M
- 32 33 16.5K 16.5K 16.5K 1.31K 668K 668K 668K
- 64 6 5.50K 3.50K 3.50K 452 402K 262K 262K
- 128 3 2K 1.50K 1.50K 444 302K 222K 222K
- DDT-sha256-zap-unique: 38603 entries, size 394 on disk, 251 in core
- bucket allocated referenced
- ______ ______________________________ ______________________________
- refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE
- ------ ------ ----- ----- ----- ------ ----- ----- -----
- 1 37.7K 2.09G 645M 645M 37.7K 2.09G 645M 645M
- DDT-edonr-zap-duplicate: 105314 entries, size 301 on disk, 162 in core
- bucket allocated referenced
- ______ ______________________________ ______________________________
- refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE
- ------ ------ ----- ----- ----- ------ ----- ----- -----
- 2 43.2K 4.80G 4.57G 4.57G 87.6K 9.60G 9.14G 9.14G
- 4 48.6K 5.60G 5.47G 5.47G 271K 31.3G 30.6G 30.6G
- 8 9.48K 958M 914M 914M 87.6K 8.65G 8.25G 8.25G
- 16 1.46K 95.4M 89.4M 89.4M 29.6K 1.82G 1.70G 1.70G
- 32 105 276K 156K 156K 3.94K 10.4M 5.89M 5.89M
- 64 9 4.50K 4.50K 4.50K 748 374K 374K 374K
- 128 2 1K 1K 1K 268 134K 134K 134K
- 512 1 512B 512B 512B 550 275K 275K 275K
- 1K 5 2.50K 2.50K 2.50K 7.77K 3.88M 3.88M 3.88M
- DDT-edonr-zap-unique: 47842 entries, size 310 on disk, 164 in core
- bucket allocated referenced
- ______ ______________________________ ______________________________
- refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE
- ------ ------ ----- ----- ----- ------ ----- ----- -----
- 1 46.7K 4.75G 4.38G 4.38G 46.7K 4.75G 4.38G 4.38G
- DDT histogram (aggregated over all DDTs):
- bucket allocated referenced
- ______ ______________________________ ______________________________
- refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE
- ------ ------ ----- ----- ----- ------ ----- ----- -----
- 1 84.4K 6.84G 5.01G 5.01G 84.4K 6.84G 5.01G 5.01G
- 2 70.1K 5.72G 4.80G 4.80G 148K 12.1G 9.68G 9.68G
- 4 83.7K 6.40G 5.72G 5.72G 413K 34.6G 31.6G 31.6G
- 8 9.94K 965M 916M 916M 91.7K 8.71G 8.27G 8.27G
- 16 1.65K 95.5M 89.5M 89.5M 33.4K 1.82G 1.70G 1.70G
- 32 138 293K 172K 172K 5.25K 11.0M 6.54M 6.54M
- 64 15 10K 8K 8K 1.17K 776K 636K 636K
- 128 5 3K 2.50K 2.50K 712 436K 356K 356K
- 512 1 512B 512B 512B 550 275K 275K 275K
- 1K 5 2.50K 2.50K 2.50K 7.77K 3.88M 3.88M 3.88M
- Total 250K 20.0G 16.5G 16.5G 786K 64.0G 56.3G 56.3G
- dedup = 3.41, compress = 1.14, copies = 1.00, dedup * compress / copies = 3.88
- root@jimoi:/usr/share/znapzend# zpool get all nvpool
- NAME PROPERTY VALUE SOURCE
- nvpool size 744G -
- nvpool capacity 94% -
- nvpool altroot - default
- nvpool health DEGRADED -
- nvpool guid 185555628905970312 default
- nvpool version - default
- nvpool bootfs nvpool/ROOT/hipster_2020.04-20200809T192157Z local
- nvpool delegation on default
- nvpool autoreplace off default
- nvpool cachefile - default
- nvpool failmode continue local
- nvpool listsnapshots off default
- nvpool autoexpand off default
- nvpool dedupditto 0 default
- nvpool dedupratio 3.40x -
- nvpool free 39.8G -
- nvpool allocated 704G -
- nvpool readonly off -
- nvpool comment - default
- nvpool expandsize - -
- nvpool freeing 0 default
- nvpool fragmentation 67% -
- nvpool leaked 0 default
- nvpool bootsize - default
- nvpool checkpoint - -
- nvpool multihost off default
- nvpool ashift 0 default
- nvpool autotrim off default
- nvpool feature@async_destroy enabled local
- nvpool feature@empty_bpobj active local
- nvpool feature@lz4_compress active local
- nvpool feature@multi_vdev_crash_dump enabled local
- nvpool feature@spacemap_histogram active local
- nvpool feature@enabled_txg active local
- nvpool feature@hole_birth active local
- nvpool feature@extensible_dataset active local
- nvpool feature@embedded_data active local
- nvpool feature@bookmarks enabled local
- nvpool feature@filesystem_limits enabled local
- nvpool feature@large_blocks active local
- nvpool feature@large_dnode enabled local
- nvpool feature@sha512 enabled local
- nvpool feature@skein enabled local
- nvpool feature@edonr active local
- nvpool feature@device_removal enabled local
- nvpool feature@obsolete_counts enabled local
- nvpool feature@zpool_checkpoint enabled local
- nvpool feature@spacemap_v2 active local
- nvpool feature@allocation_classes disabled local
- nvpool feature@resilver_defer disabled local
- nvpool feature@encryption disabled local
- nvpool feature@bookmark_v2 disabled local
- nvpool feature@userobj_accounting disabled local
- nvpool feature@project_quota disabled local
- nvpool feature@log_spacemap disabled local
- ### UPDATE after a while: now "USED" sums up to more than the pool size is
- root@jimoi:/root# zfs list -d1 -ospace -sused -r nvpool
- NAME AVAIL USED USEDSNAP USEDDS USEDREFRESERV USEDCHILD
- nvpool/tmp 8.16G 23K 0 23K 0 0
- nvpool/kohsuke 8.16G 59K 13K 23K 0 23K
- nvpool/test 8.16G 73K 0 25K 0 48K
- nvpool/SHARED-nobackup 8.16G 70.8M 0 24K 0 70.7M
- nvpool/temp 8.16G 668M 0 668M 0 0
- nvpool/dump 8.16G 1.00G 0 1.00G 0 0
- nvpool/var-squid-cache 8.16G 7.16G 0 7.16G 0 0
- nvpool/swap 8.65G 8.50G 0 8.01G 501M 0
- nvpool/zones 8.16G 9.42G 0 23K 0 9.42G
- nvpool/SHARED 8.16G 18.4G 0 23K 0 18.4G
- nvpool/ROOT 8.16G 89.7G 0 23K 0 89.7G
- nvpool/Media 8.16G 139G 184M 138G 0 0
- nvpool/export 8.16G 277G 0 23K 0 277G
- nvpool 8.16G 751G 14K 36K 0 751G
- root@jimoi:/root# zfs list -d1 -ospace -sused -p -r nvpool
- NAME AVAIL USED USEDSNAP USEDDS USEDREFRESERV USEDCHILD
- nvpool/tmp 8775617888 23552 0 23552 0 0
- nvpool/kohsuke 8775617888 60416 13312 23552 0 23552
- nvpool/test 8775617888 74752 0 25600 0 49152
- nvpool/SHARED-nobackup 8775617888 74200576 0 24576 0 74176000
- nvpool/temp 8775617888 700783616 0 700783616 0 0
- nvpool/dump 8775617888 1073847296 0 1073847296 0 0
- nvpool/var-squid-cache 8775617888 7692004864 0 7692004864 0 0
- nvpool/swap 9300844896 9126805504 0 8601578496 525227008 0
- nvpool/zones 8775617888 10115492352 0 23552 0 10115468800
- nvpool/SHARED 8775617888 19771040768 0 23552 0 19771017216
- nvpool/ROOT 8775617888 96337416704 0 23552 0 96337393152
- nvpool/Media 8775617888 148885252096 192455680 148692796416 0 0
- nvpool/export 8775617888 297791069696 0 23552 0 297791046144
- nvpool 8775617888 806495139840 14336 36864 0 806495088640
- # ... and dude, where's my 200 gig?
- root@jimoi:/root# expr 297791069696 + 148885252096 + 96337416704 + 19771040768 + 10115492352 + 9126805504 + 7692004864 + 1073847296 + 700783616 + 74200576
- 591567913472
- root@jimoi:/root# expr 806495139840 - 591567913472
- 214927226368
- root@jimoi:/root# zpool list nvpool
- NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
- nvpool 744G 711G 33.1G - - 71% 95% 3.40x DEGRADED -
- root@jimoi:/root# zpool list -p nvpool
- NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
- nvpool 798863917056 763290726400 35573190656 - - 71% 95 3.40x DEGRADED -
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement