You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Scanning on Linux ext4 very slow in version 1.22.0 #8590
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 discussionneeds-triageNew issues needed to be validated
which version of Syncthing and what operating system you are using
1.22.0
what happened,
I have 3 servers syncing. 1 is MacOs M1 that has no issues. The other 2 are Ubuntu x86_64 on kernel 4.15.0-192 and 5.15.0-362206031516 and both of them are constantly thrashing the disk and never completing syncing.
I have not enabled any of the new extended attribute settings in 1.22.0
what you expected to happen instead, and
Expect it to scan as fast as 1.21.0 and/or the MacOs with 1.22.0
any steps to reproduce the problem.
upgrade from 1.21.0 to 1.22.0 on an Ubuntu os with and ext4 file system
Here are logs of pressing "rescan" on a small folder on both macos and ubuntu. I only enabled the scanner log.
It looks like that on ubuntu it for some reason believes some, but not all, files have changed and it re-hashes them
On some of my larger directories it just continues re-hashing and never finishes
So, the one new thing that would cause that is we now record the inode change time and use it when comparing for changes. Unfortunately that value isn't printed in the debug output (adding that now...) but you can inspect it using the CLI for a known file;
syncthing cli debug file $folderID $filePath
If you could paste the output for a file that keeps getting rescanned so we can see which attributes change that would be helpful. If it's just the inode change time, that's ... odd, I don't know why it would keep changing, but it would explain what's going on.
Are you running anything else that might be relevant at the same time -- some dedup thing, or some backup program that sets attributes on the files to mark the processed, or something like that?
(FTR I'm not seeing this at all on Linux, but my files are on ZFS.)
The ones I see rescanning all have 1969-12-31T18:00:00-06:00 in one or the other inodeChange fields and a current date in the other. Ones that work either have 1969-12-31T18:00:00-06:00 in both or a current date in both.
Yeah both of those situations are normal, the question is if the ones that have a current date in the local part have that date change from pass to pass.
I can confirm they are not changing between scans yet that file is scanned every time
I even did a json diff of the output and confirmed no values are changing
Also confirmed the directory the same way and it is also not changing
Could this be caused by an overflow? The date obviously corresponds to the start of the unix epoch, but if it ignores the timezone part, we'd get a negative number. If it then interprets that as an unsigned int, it will be larger than the current time.
No, there's no overflow, the comparison looks at the timestamp as nanoseconds-since-the-epoch, the rest is just formatting for the current time zone. I have no idea what would cause the behaviour in question, but the debug output from the scanner is kind of crappy -- both ridiculously verbose and lacking relevant details at the same time, so I'll improve that and then we can test this with a dev build.
Something a little interesting to add to this. On the smaller folder I've been testing on I ran find . -type f -exec touch {} + and after it scanned everything once it is no longer reproducible on that folder.
I do still have more folders I can reproduce this on when you get a build that you want me to try.
So when scanned "locally" they're fine... if you touch one of those files from another host, so that the changed gets synced to the problematic one, does that trigger the problem for that file?
Now that I have touched all the files in that folder it is no longer reproducible. Touching on any of the remote hosts causes them to rescan but does not trigger the issue on the local problematic host.
It's worth noting that for the folders that this is still reproducible on, if I downgrade to 1.21.0 it is fine again. Upgrading to 1.22.0 triggers it again but not for the folder that I have touched all the files in.
I wonder what's special then, given that it wasn't that the new attribute we look at keeps changing. Why isn't everyone seeing this on their computers...
Another interesting test...
On the MacOs host running 1.22.0 I touched all the files in a problematic directory and let that sync to the problematic Ubuntu hosts while they were running 1.21.0. I then upgraded them to 1.22.0 and that directory was fine after that everywhere.
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 discussionneeds-triageNew issues needed to be validated
Activity
calmh commentedon Oct 7, 2022
"constantly thrashing the disk and never completing syncing" doesn't sound like scanning, in Syncthing terminology.
Do you have logs of what it's doing? I'm not aware of any relevant changes in 1.22.0, apart from obviously the xattr stuff that you didn't enable.
mickgiles commentedon Oct 7, 2022
Here are logs of pressing "rescan" on a small folder on both macos and ubuntu. I only enabled the scanner log.
It looks like that on ubuntu it for some reason believes some, but not all, files have changed and it re-hashes them
On some of my larger directories it just continues re-hashing and never finishes
Working -- macos
macos.txt
Not working -- ununtu
ubuntu.txt
calmh commentedon Oct 7, 2022
So, the one new thing that would cause that is we now record the inode change time and use it when comparing for changes. Unfortunately that value isn't printed in the debug output (adding that now...) but you can inspect it using the CLI for a known file;
If you could paste the output for a file that keeps getting rescanned so we can see which attributes change that would be helpful. If it's just the inode change time, that's ... odd, I don't know why it would keep changing, but it would explain what's going on.
Are you running anything else that might be relevant at the same time -- some dedup thing, or some backup program that sets attributes on the files to mark the processed, or something like that?
(FTR I'm not seeing this at all on Linux, but my files are on ZFS.)
mickgiles commentedon Oct 7, 2022
mickgiles commentedon Oct 7, 2022
The ones I see rescanning all have
1969-12-31T18:00:00-06:00in one or the other inodeChange fields and a current date in the other. Ones that work either have1969-12-31T18:00:00-06:00in both or a current date in both.calmh commentedon Oct 7, 2022
Yeah both of those situations are normal, the question is if the ones that have a current date in the
localpart have that date change from pass to pass.mickgiles commentedon Oct 7, 2022
I can confirm they are not changing between scans yet that file is scanned every time
I even did a json diff of the output and confirmed no values are changing
Also confirmed the directory the same way and it is also not changing
schuetzm commentedon Oct 8, 2022
Could this be caused by an overflow? The date obviously corresponds to the start of the unix epoch, but if it ignores the timezone part, we'd get a negative number. If it then interprets that as an unsigned int, it will be larger than the current time.
calmh commentedon Oct 8, 2022
No, there's no overflow, the comparison looks at the timestamp as nanoseconds-since-the-epoch, the rest is just formatting for the current time zone. I have no idea what would cause the behaviour in question, but the debug output from the scanner is kind of crappy -- both ridiculously verbose and lacking relevant details at the same time, so I'll improve that and then we can test this with a dev build.
mickgiles commentedon Oct 8, 2022
Something a little interesting to add to this. On the smaller folder I've been testing on I ran
find . -type f -exec touch {} +and after it scanned everything once it is no longer reproducible on that folder.I do still have more folders I can reproduce this on when you get a build that you want me to try.
calmh commentedon Oct 8, 2022
So when scanned "locally" they're fine... if you touch one of those files from another host, so that the changed gets synced to the problematic one, does that trigger the problem for that file?
mickgiles commentedon Oct 8, 2022
Now that I have touched all the files in that folder it is no longer reproducible. Touching on any of the remote hosts causes them to rescan but does not trigger the issue on the local problematic host.
It's worth noting that for the folders that this is still reproducible on, if I downgrade to 1.21.0 it is fine again. Upgrading to 1.22.0 triggers it again but not for the folder that I have touched all the files in.
calmh commentedon Oct 8, 2022
I wonder what's special then, given that it wasn't that the new attribute we look at keeps changing. Why isn't everyone seeing this on their computers...
mickgiles commentedon Oct 8, 2022
I can certainly just touch all the files and let it rescan them to solve for myself but it would be good to understand why this is happening.
mickgiles commentedon Oct 8, 2022
Another interesting test...
On the MacOs host running 1.22.0 I touched all the files in a problematic directory and let that sync to the problematic Ubuntu hosts while they were running 1.21.0. I then upgraded them to 1.22.0 and that directory was fine after that everywhere.