r/Snapraid • • 6d ago

Syncing more data than exists

Post image

EDIT: Solved in https://www.reddit.com/r/Snapraid/s/QeqzHUXBZY

I'm having an issue where every time Snapraid runs a Sync operation and one specific file is involved (has been changed), the sync seems to run for almost an hour, and transfer/check/process hundreds of GB of data.

The single file in question (a qcow disk image that was booted up and then immediately shutdown)... is only about 30 GB total size. Why does this keep happening? Is my Snapraid array broken?

My understanding is that the sync should be almost instant, if almost nothing changed. I confirmed its just this one single file with a snapraid diff first.

OMV version: 8.6.1-1 (Synchrony)

Plugin version: openmediavault-snapraid 8.0.3

5 Upvotes

18 comments sorted by

2

u/Disciplined_20-04-15 6d ago

How many disks in your array? If there’s 6 disks snap raid has to read 30gb of data on 6 disks = 180GB total

1

u/mitchplze 6d ago

5x data disks, 1x parity.

That doesn't quite make sense, as the 30 GB only exists on one single physical data drive (I'm using mergerfs).

4

u/Disciplined_20-04-15 6d ago

VM disk image is probably a worse case for snapraid as it’s a file that minor changes could impact blocks across the entire file. Snapraid is better suited for static files that have infrequent changes.

If snapraid detects block changes across the 30GB. It must recalculate parity. Reading the changed blocks from the data. Reading existing parity. Reading corresponding blocks from other data disks when calculating parity where needed. Writing updated parity blocks.

1

u/mitchplze 6d ago

Totally get that. This is a PBS (Proxmox Backup Server) datastore disk, which is my compromise for not obviously being able to run *all* my disks live on NFS, to OMV with Snapraid.

So how is Snapraid reading in hundreds of GB, when the total size of the file altogether is < 30 GB? Where are these hundreds of GB coming from? Or is it rewriting the entire parity file on the destination?

6

u/Disciplined_20-04-15 6d ago

Yes if the 30GB file is changed, the parity needs to be rewritten for corresponding blocks. Seeing 100-200GB processed for a 30GB change is not unusual.

(The I/O you see is total read and writes of all disks)

2

u/mitchplze 6d ago

Gotcha, that makes much more sense. Thanks!

I guess my confusion was why I don't see this type of behaviour/delay when thousands of small files are changed (even multiple GB worth) - just on big files.

0

u/[deleted] 6d ago edited 6d ago

[removed] — view removed comment

1

u/mitchplze 6d ago

I don't think there's any misunderstanding. On a 5 TB array for example, if you only change 10 MB worth of files, sync will in fact, be almost instant.

I wasn't suggesting anyone change how Snapraid operates, to make it block-level.

0

u/BootToggle 6d ago

I thought we were discussing your example. Sorry to have troubled you.

1

u/capecodcarl 6d ago

If the QCOW2 disk image was created as a sparse file (dynamically grows as the logical drive gets filled with data) then I believe Snapraid will need to parse the entire logical file size every time the file is modified regardless of the actual size of the file being reported by the filesystem.

1

u/mitchplze 6d ago

Sure, but if the disk image is only 30 GB total size (maybe 15 GB filled), how is Snapraid reading in hundreds of GB? Where is it coming from?

1

u/capecodcarl 6d ago

Ah, sorry, nevermind then. I see others have a more plausible explanation below.

1

u/divestblank 6d ago

how much data do you have? what is the total read by snapraid after syncing?

1

u/mitchplze 6d ago

Total used size of the mergerfs pool source is ~3 TB.

How do I determine the read amount, is that this line?

100% completed, 908408 MB accessed in 0:49

2

u/divestblank 6d ago

What disciplined said makes sense. You should expected 200GB of sync. Run `snapraid diff` before your next sync to see what files have changed first. Also, are you getting any warnings for files with zero sub-second timestamps?

1

u/mitchplze 6d ago

Diff just shows that one file (30 GB).

I was previously getting warnings about timestamps, but I fixed that before.

2

u/Due-Plum5653 6d ago

I think someone mentioned its your data changed 30gb, x 5 disks to run the parity = 150

1

u/mitchplze 6d ago

I guess that makes sense. In my mind... if that 30 GB file only exists on one data disk (it does), then the other 4 data disks should not need to be read/hashed at all - only the parity destination should change.