Re: Odd behaviour of two identical ZFS servers mirroring via rsync

From: Bob Friesenhahn <bfriesen_at_simple.dallas.tx.us>
Date: Fri, 11 Nov 2022 20:51:06 UTC
On Fri, 11 Nov 2022, andy thomas wrote:
>
> It seems almost as if ZFS is not freeing up blocks when rsync has deleted or 
> shrank files, leaving unwanted blocks lurking around in the folder that 'du' 
> then discovers and adds to its tally when it works out the space usage of 
> that folder!

This would be completely expected behavior if zfs snapshots are used.

The rsync block sizes can be adjusted to be a better match for zfs 
block sizes (e.g. 128k).  For example, zfs will do a 'sync' to write 
new data to disk and it will help if all of the data in an new/updated 
zfs block is provided at the time of the 'sync' (rather than 1/4 or 
1/2 of the block).

Network buffering can also be a factor since it effects the timing of 
data delivery to the backup server.  If the sending side tends to 
stall, then add more buffering.

Bob
-- 
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
Public Key,     http://www.simplesystems.org/users/bfriesen/public-key.txt