-
Notifications
You must be signed in to change notification settings - Fork 663
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
Resuming a paused sync that was uploading a bunch of files and were moved in the client is duplicating one file in both locations #5949
Comments
Here is what happens: The solution could be to change what "pause sync" is doing. We should not blindly abort all requests. We should wait for the PUT to finish (possibly with a lower timeout) |
Or abort depending on if all data had been sent already. This should be doable since the upload speed limiting gives us this much control over the data flow. So only do a hard abort() if not all data was sent. |
Something that crosses my mind: since the same would happen on client crash/being killed is there a solution we could apply both for it and pause? e.g. a 'handshake' when starting a sync to check if last operation(s) before the crash were completed on the server. |
@SamuAlfageme that's quite hard when moves are involved i think :-/ In other cases, we can/could do a lot based on filesize/mtime/filehash |
when the client crash or is killed, or if the connection drops right at the right moment, there is no way to know if the file was uploaded or not. So we recover in the next sync. But if the file is moved or edited in the next sync, we have a conflict. This is something we have to live with. Only when pausing/aborting the sync, we can do something about it. |
@ogoffart you can assign me to it if you want, it does not seem difficult. |
I see 2 use cases for timeout of e.g. 5 sec:
The others, it might not make sense because of filesize or because protocol is obsolete (old chunking) |
@mrow4a What do you mean? This would be about abort() only. I think what I had proposed in #5949 (comment) is enough.. |
PR ready #5953 |
Dont abort final chunk immedietally Use sync and async aborts
Dont abort final chunk immedietally Use sync and async aborts
Dont abort final chunk immedietally Use sync and async aborts
Dont abort final chunk immedietally Use sync and async aborts
Wouldn't this be a situation where the local and remote checksums are identical, therefore skipping the download and just populating the etag on the next sync? Aka: is there really an issue here? |
I am not sure @ckamm how is that related to aborting, which just waits a bit until the job is finished, doing no harm to nothing. |
I made a testcase for this, will add here later. |
@mrow4a I think it's the other way around. We're discussing the introduction of complex aborting logic in response to this issue. If the issue doesn't exist, why introduce aborting? It's possible that my test case doesn't go far enough. But I'd like to know whether you or @ogoffart managed to reproduce the problem with master. |
Dont abort final chunk immedietally Use sync and async aborts
Dont abort final chunk immedietally Use sync and async aborts
Dont abort final chunk immedietally Use sync and async aborts
Expected behavior
The reconcile phase should match the server and local contents properly and move the last file the client uploaded to the server.
Actual behavior
That last file is being downloaded from the server:
I think it has to do with pausing the sync either:
Steps to reproduce
generate_n_files.sh 130 file_ 15M
: 130 files , 15MB size with thefile_
prefix)mkdir filezz && mv file_* filezz
)Server configuration
Client configuration
Client version: 2.3.3rc1
Logs
grep file_114
in this case) - https://gist.github.com/SamuAlfageme/b9e6a34e7fcd3963c7bb6a353995668fI also have the recorded mitmproxy session recorded, will upload in a minute (after removing sensitive info)
cc/ @ogoffart @guruz @mrow4a
The text was updated successfully, but these errors were encountered: