mutagen-io / mutagen

Fast file synchronization and network forwarding for remote development
https://mutagen.io
Other
3.41k stars 151 forks source link

Add support for hardlink detection and matching #493

Open scruel opened 5 months ago

scruel commented 5 months ago

The main problem here is that mutagen will break all hard links between beta and alpha... For example, on alpha, we execute:

$ echo aaa > 111
$ ln 111 222
$ cat 222
aaa
$ echo bbb > 222
$ cat 111
bbb

Then start mutagen, wait files got synced on beta, execute:

$ echo ccc > 111
$ cat 111
ccc
$ cat 222
bbb

Now wait files got synced from beta to alpha, execute:

$ cat 111
ccc
$ cat 222
bbb

You can see mutagen just broke the hard link... It not only will result in doubling the disk space usage, but will also lead to unexpected problems, because hard links excepted to point to the same data block.

Related: https://github.com/mutagen-io/mutagen/issues/309

xenoscopic commented 4 months ago

We'll have to leave this as a known-issue for now. Adding support for hardlink detection/matching (analogous to rsync's -H/--hard-links) is possible, but it would be a fair amount of work.