Inconsistent ZFS space release behavior with daily DB backups and replication

bzz

New Member
May 7, 2026
4
0
1
Hi everyone,

I'm seeing an odd storage usage behavior on local ZFS with Proxmox replication that I'd like to understand better.

Setup:
- 2 Proxmox nodes (node1 and node2)
- VM 100: Windows 11
- Daily replication task from node1 to node2 scheduled at 05:00

The workflow:
Inside the VM, a task runs daily at 19:45 creating a full approx. 100 GB database backup. It finishes after about an hour and deletes the previous day's backup. At 05:00, the Proxmox replication task runs.

The issue:
The space release on local-zfs behaves inconsistently after the replication finishes:
- On some days, right after replication completes, ZFS space drops correctly by 100 GB, properly reflecting the deleted backup.
- On other days, it barely drops at all and stays constant. The next day, after another +100 GB backup occurs, right after that day's replication finishes, there is a sudden 200 GB drop that brings the usage back to where it should be.

Has anyone experienced this delayed space release pattern on ZFS tied to replication, or know what might be causing it?

Thanks!

1792426760489.png
 
I got some help from AI, and it seems the problem is that TRIM doesn't always pass through or execute properly. The AI brought up block size, but I'm not sure if that has anything to do with it...
What could be blocking TRIM? I've already configured ssd emulation and discard in the VM

1793204124795.png
 
I already set Windows to run optimize every day. Today I changed it to monthly to see if something changes.

This is the refreservation
Code:
root@han:~# zfs list -o name,used,avail,refer,mountpoint,refquota,refreservation
NAME                           USED  AVAIL  REFER  MOUNTPOINT                     REFQUOTA  REFRESERV
rpool                          438G   485G   104K  /rpool                             none       none
rpool/ROOT                    26.7G   505G    96K  /rpool/ROOT                        none        20G
rpool/ROOT/pve-1              6.70G   485G  6.70G  /                                  none       none
rpool/data                     411G   485G    96K  /rpool/data                        none       none
rpool/data/subvol-101-disk-0   471M  1.54G   471M  /rpool/data/subvol-101-disk-0        2G       none
rpool/data/subvol-102-disk-0   474M  2.54G   474M  /rpool/data/subvol-102-disk-0        3G       none
rpool/data/vm-100-disk-0       148K   485G   148K  -                                     -       none
rpool/data/vm-100-disk-1       410G   485G   408G  -                                     -       none
rpool/data/vm-100-disk-2        64K   485G    64K  -                                     -       none
rpool/var-lib-vz               124M   485G   124M  /var/lib/vz                        none       none
 
I forgot to ask, do you have (automated) snapshots by any chance? zfs list -ospace should reveal that.
 
No, I didn't setup any snapshot

Code:
root@han:~# zfs list -ospace
NAME                          AVAIL   USED  USEDSNAP  USEDDS  USEDREFRESERV  USEDCHILD
rpool                          486G   437G        0B    104K             0B       437G
rpool/ROOT                     506G  26.7G        0B     96K          20.0G      6.70G
rpool/ROOT/pve-1               486G  6.70G        0B   6.70G             0B         0B
rpool/data                     486G   410G        0B     96K             0B       410G
rpool/data/subvol-101-disk-0  1.54G   471M        0B    471M             0B         0B
rpool/data/subvol-102-disk-0  2.54G   475M        0B    475M             0B         0B
rpool/data/vm-100-disk-0       486G   148K        0B    148K             0B         0B
rpool/data/vm-100-disk-1       486G   409G      947M    408G             0B         0B
rpool/data/vm-100-disk-2       486G    64K        0B     64K             0B         0B
rpool/var-lib-vz               486G   124M        0B    124M             0B         0B