Repository navigation
Closed
Labels
bugA problem with current functionality, as opposed to missing functionality (enhancement)frozen-due-to-ageIssues closed and untouched for a long time, together with being locked for discussion
Milestone
Description
This happens using Syncthing v1.22.0.
Given two clients, A and B. For a file created by A, extended attribute modifications are only synced from A to B, not from B to A.
So let's say I do the following (Scenario 1):
- A:
touch test.txt; setfattr -n user.test -v test test.txt - B:
setfattr -n user.test2 -v test2 test.txt
Only test.txt on B will have both attributes, it's not being synced from B. The same happens the other way around (Scenario 2):
- B:
touch test2.txt; setfattr -n user.test -v test test2.txt - A:
setfattr -n user.test2 -v test2 test2.txt
Only test.txt on A will have both attributes.
Restarting syncthing makes no difference, this behavior seems set at file creation.
Interestingly, the change is picked up, but not transmitted for some reason (this is B from scenario 1, step 2):
[TWUEC] 2022/10/08 17:54:41.627739 basicfs_watch.go:102: DEBUG: basic /var/syncthing/Test Watch: Sending test.txt non-remove
[TWUEC] 2022/10/08 17:54:41.627784 aggregator.go:296: DEBUG: aggregator/"Test" (errvk-ajxc3): Tracking (type non-remove): test.txt
[TWUEC] 2022/10/08 17:54:41.627804 aggregator.go:315: DEBUG: aggregator/"Test" (errvk-ajxc3): Resetting notifyTimer to 10s
[TWUEC] 2022/10/08 17:54:51.627968 aggregator.go:347: DEBUG: aggregator/"Test" (errvk-ajxc3): Notifying about 1 fs events
[TWUEC] 2022/10/08 17:54:51.628012 aggregator.go:315: DEBUG: aggregator/"Test" (errvk-ajxc3): Resetting notifyTimer to 10s
[TWUEC] 2022/10/08 17:54:51.628094 logfs.go:115: DEBUG: folderconfiguration.go:116 basic /var/syncthing/Test Stat . {0xc0000b7520} <nil>
[TWUEC] 2022/10/08 17:54:51.628204 logfs.go:115: DEBUG: folderconfiguration.go:134 basic /var/syncthing/Test Stat .stfolder {0xc0000b7790} <nil>
[TWUEC] 2022/10/08 17:54:51.628255 logfs.go:163: DEBUG: folder.go:334 basic /var/syncthing/config/index-v0.14.0.db Usage . {2078167924736 2078168711168} <nil>
[TWUEC] 2022/10/08 17:54:51.628434 events.go:334: DEBUG: log 37 StateChanged map[duration:23.628311741 folder:errvk-ajxc3 from:idle to:scan-waiting]
[TWUEC] 2022/10/08 17:54:51.628510 events.go:334: DEBUG: log 38 StateChanged map[duration:0.628361153 folder:errvk-ajxc3 from:scan-waiting to:scanning]
[TWUEC] 2022/10/08 17:54:51.628818 walk.go:123: DEBUG: walker/errvk-ajxc3@0xc0007f20b0 Walk [test.txt] Matcher/[]@0xc0008e6000
[TWUEC] 2022/10/08 17:54:51.628984 walkfs.go:84: DEBUG: walk: path=test.txt
[TWUEC] 2022/10/08 17:54:51.629643 walk.go:423: DEBUG: walker/errvk-ajxc3@0xc0007f20b0 rescan: File{Name:"test.txt", Sequence:22, Permissions:0644, ModTime:2022-10-08 17:54:13.090756718 +0000 UTC, Version:{[{ATW3ZMM 1665251668}]}, VersionHash:, Length:0, Deleted:false, Invalid:false, LocalFlags:0x0, NoPermissions:false, BlockSize:131072, Blocks:[Block{0/0/0/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855}], BlocksHash:d3bfe98e8f1ce891614854569a20f5f4508d6ab4025b872b7b3a8282ef75b12a, Platform:{<nil> <nil> xattrs:<name:"user.test1" value:"test1" > <nil> <nil> <nil>}} 1665251653 -rw-r--r--
[TWUEC] 2022/10/08 17:54:51.629705 walk.go:426: DEBUG: walker/errvk-ajxc3@0xc0007f20b0 to hash: test.txt File{Name:"test.txt", Sequence:0, Permissions:0644, ModTime:2022-10-08 17:54:13.090756718 +0000 UTC, Version:{[{ATW3ZMM 1665251668} {TWUECHX 1665251691}]}, VersionHash:, Length:0, Deleted:false, Invalid:false, LocalFlags:0x0, NoPermissions:false, BlockSize:131072, Blocks:[], BlocksHash:, Platform:{<nil> <nil> xattrs:<name:"user.test1" value:"test1" > xattrs:<name:"user.test2" value:"test2" > <nil> <nil> <nil>}}
[TWUEC] 2022/10/08 17:54:51.629814 walk.go:198: DEBUG: walker/errvk-ajxc3@0xc0007f20b0 real to hash: test.txt
[TWUEC] 2022/10/08 17:54:51.630085 walk.go:176: DEBUG: walker/errvk-ajxc3@0xc0007f20b0 Walk progress done errvk-ajxc3 [test.txt] Matcher/[]@0xc0008e6000
[TWUEC] 2022/10/08 17:54:51.630182 logfs.go:115: DEBUG: folderconfiguration.go:116 basic /var/syncthing/Test Stat . {0xc000379e10} <nil>
[TWUEC] 2022/10/08 17:54:51.630244 logfs.go:115: DEBUG: folderconfiguration.go:134 basic /var/syncthing/Test Stat .stfolder {0xc001533c70} <nil>
[TWUEC] 2022/10/08 17:54:51.630309 logfs.go:163: DEBUG: folder.go:334 basic /var/syncthing/config/index-v0.14.0.db Usage . {2078167924736 2078168711168} <nil>
[TWUEC] 2022/10/08 17:54:51.630687 events.go:334: DEBUG: log 39 LocalIndexUpdated map[filenames:[test.txt] folder:errvk-ajxc3 items:1 sequence:23 version:23]
[TWUEC] 2022/10/08 17:54:51.630735 events.go:334: DEBUG: log 40 LocalChangeDetected map[action:modified folder:errvk-ajxc3 folderID:errvk-ajxc3 label:Test modifiedBy:TWUECHX path:test.txt type:file]
[TWUEC] 2022/10/08 17:54:51.630889 events.go:334: DEBUG: log 41 StateChanged map[duration:0.630799815 folder:errvk-ajxc3 from:scanning to:idle]
[TWUEC] 2022/10/08 17:54:52.594940 events.go:334: DEBUG: log 42 FolderSummary {errvk-ajxc3 0xc000c5b4a0}
[TWUEC] 2022/10/08 17:54:52.595076 events.go:334: DEBUG: log 43 FolderCompletion map[completion:100 device:ATW3ZMM-DJ3APTY-WA372XM-4KMWDNX-TNGCN7W-NTE543B-5IJRG7D-QLNLLAY folder:errvk-ajxc3 globalBytes:0 globalItems:1 needBytes:0 needDeletes:0 needItems:1 remoteState:valid sequence:37]
[TWUEC] 2022/10/08 17:55:01.628904 aggregator.go:323: DEBUG: aggregator/"Test" (errvk-ajxc3): No tracked events, waiting for new event.
Metadata
Metadata
Assignees
Labels
bugA problem with current functionality, as opposed to missing functionality (enhancement)frozen-due-to-ageIssues closed and untouched for a long time, together with being locked for discussion
Activity
calmh commentedon Oct 8, 2022
FWIW this doesn't reproduce for me on macOS, things get synced properly in both directions. What OS and filesystem are you testing on?
mafredri commentedon Oct 8, 2022
Interesting, I could've sworn I saw this behavior between macOS and a macOS VM as well.
The above was done on Linux with ZFS on both sides (Syncthing running in Docker).
calmh commentedon Oct 8, 2022
Allright, Linux on ext4 also doesn't show this issue for me, though I'm not testing with Docker involved.
mafredri commentedon Oct 8, 2022
Ok, looks like my initial analysis was wrong (sorry about that) and I ran into two things:
So obviously the latter is user error 🤦🏻.
But in 1), I'm not sure how many clients are required, but that's the setup I have currently. I believe it was only L1 <-> L2 <-> M1 when I first ran into the issue and started digging (and then creating the second issue in the process).
So let's say I do the following:
touch test.txtsetfattr -n user.test -v test test.txtsetfattr -n user.test2 -v test2 test.txtThen
user.testis never propagated toL1anduser.test2is never propagated toL2.Similarly creating a file on L2 breaks xattrs between M1/M2.
mafredri commentedon Oct 8, 2022
Hmm, that's weird. If we continue on those steps:
touch test.txtsetfattr -n user.test -v test test.txtsetfattr -n user.test2 -v test2 test.txtrm test.txtAfter 4)
test.txtwill re-appear onL2with theuser.test2attr fromL1. So it seems there's a sync issue leaving it in limbo, but Syncthing is reporting "Up to date" on all 4 machines.calmh commentedon Oct 8, 2022
Yes, there is a weirdness. Looking into it.
calmh commentedon Oct 8, 2022
OK, so here's the thing (FYI myself and other developers)... I thought I was clever when I crafted the comparisons for xattrs and ownership, in that we only consider a file info different if it's set on both sides -- otherwise a file would be unequal and require resync as soon as it's synced to a new operating system and new attributes picked up. But precisely that actually needs to happen, otherwise we don't send out the change when a file comes from linux and we add attributes on macos, and things like that. We need to pick up those attributes and send back the changed file. There are details in making that happen properly that I'll hopefully be able to deal with, PR upcoming at some point tomorrowish...
One potentially interesting side effect is a cluster with two sendOwnership or sendXattrs devices won't work. Device A will send a file with some ownership information, device B will sync the file and not apply the ownership information, then pick up its own ownership info and send that, which will cause a resync on A where it doesn't apply the ownership info but sends out a new update with its own ownership info and then goto 10
lib/model, lib/protocol: Fix file comparisons (fixes #8594) (#8603)
Merge branch 'main' into fix-8556