google/cdc-file-transfer

Patching of file isn't working

azvenigo opened this issue · 3 comments

I'm testing the behavior when a file hasn't changed by size or date but I'd still like to be able to break it up by CDC and patch. (Using the -c checksum flag to ensure it breaks the file up by chunks and look for existing chunks on the server.)

What I'm finding is that, even though a file hasn't changed, it's not finding any matching chunks on the server and ends up transmitting the entire file still.

It's clearly returning the right number of offsets and hashes from the server. But in TryAddChunks() where it searches for matching chunk.hash it's always coming back false.

This is with syncing a file that was just sync'd on the previous run.

Wondering if I'm doing something wrong or if there's some way the hashing algorithm differs between client (Windows 10, Intel Xeon) and server (Ubuntu, Threadripper) I was planning on verifying that next but wanted to ask whether you've seen this before.

Thanks

Odd, I've never seen that. If the server chunks have not been fully transmitted, it is possible that the chunk.hash is not found until the server catches up sending the data. In that case, the patcher will just try again later until server_chunk_receiver.AllChunksReceived() is true. Is the chunk.hash not found even after server_chunk_receiver.AllChunksReceived() becomes true?

Is this reproducible with a very small file (<1KB)? In that case, there should only be one chunk, and it should be easy to check what's going on. It could be 3 things: The chunkers/hashers on the client and server get different input data (should not be the case as the files are the same), they produce different outcomes (should not be the case as both chunker and hasher should be deterministic) or something else is wrong and the hash doesn't get transmitted properly.

Also, what version are you on? 1.0.0 or latest? If you're on latest, does it repro in 1.0.0?

Hi Lutz,

Thanks very much for responding. In adding some additional logging it looks like somehow the build of the server was out of sync with the build on the client. Not clear how that happened, but at least that's the answer.

Best,
Alex

Yeah I was about to suggest that. We made a tiny change to fastcdc.h, which would perfectly explain those symptoms.