Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update and re-sort pull queue when new index updates arrive #3215

Open
AudriusButkevicius opened this issue May 29, 2016 · 7 comments
Open
Labels
enhancement New features or improvements of some kind, as opposed to a problem (bug)

Comments

@AudriusButkevicius
Copy link
Member

Or send a specific message IndexUpdateFinished to notify that there won't be any more index updates coming.

The core issue is the fact that even though we predefine some pull order, we send small indexes of 1-2 files as we scan and discover stuff, making the pull order obsolete.

This should also tie into the scanner, essentially ideally not sending any updates until the scan is actually finished, so that we'd send the whole set of changes discovered in one go.

@calmh
Copy link
Member

calmh commented May 30, 2016

While I agree that this limits the usefulness of the sorting in some cases I think most users prefer starting the sync quicker instead. But if a dive did know when the other side is "done scanning" it could of course decide to wait for that based on some config.

Doesn't tie in very cleanly with inotify.

@calmh
Copy link
Member

calmh commented May 30, 2016

Another option would be to "just" live resort and reprioritize when updates come in. Potentially cancelling sync of one file, leaving the temp file in place, and moving to another. I think this could be done fairly cleanly in my new puller whenever that sees the light of day.

@AudriusButkevicius
Copy link
Member Author

Ok, let's do that instead.

@scienmind
Copy link
Contributor

Slightly off-topic:

Regarding "leaving temp files in place" , few times I had unfinished temps littering the target folder, and not cleaning themselves:

1 - source node connects & starts sync
2 - temp created on destination device
3 - source disconnects
4 - source renames/removes the file
5 - now ~temp files are left in the target folder forever
(somehow now ST treats those temps on the destination device as actual files to be preserved and synced)

I'm not sure it it's a bug on its own, or a corner case of a desired behavior, in case it's the latter, leaving longer time frame for temps to lay around will potentially give birth to more such "obsolete" temps.

@AudriusButkevicius
Copy link
Member Author

They get removed after 24 hours by default. I can't imagine syncthing treating them as normal files if they have the syncthing specific patterns in them. Perhaps it can happen if you dual boot (as the pattern is different, but I am not sure).

@scienmind
Copy link
Contributor

scienmind commented Jun 2, 2016

That actually makes sense. I guess each time I spotted such a "leftover", I just never waited long enough for 24 hours to pass, and always removed them manually after a shorter period.

But if that is the way it cleans up, I don't see any real problem there.

@calmh
Copy link
Member

calmh commented Jun 2, 2016

We leave them around for 24 hours because they presumably contain some data we wanted, and we can reuse those blocks from the temp file instead of downloading them again.

@calmh calmh changed the title protocol: Should notify how many batches of indexes till be sent. Update and re-sort pull queue when new index updates arrive Jun 22, 2016
@calmh calmh added the enhancement New features or improvements of some kind, as opposed to a problem (bug) label Jun 22, 2016
@calmh calmh added this to the Unplanned (Contributions Welcome) milestone Jun 22, 2016
@calmh calmh removed this from the Unplanned (Contributions Welcome) milestone Feb 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New features or improvements of some kind, as opposed to a problem (bug)
Projects
None yet
Development

No branches or pull requests

3 participants