Comment by richardwhiuk
4 years ago
I'm curious whether there are common operations which cause extremely expensive resyncs - it's unclear, depending on the hash.
e.g. does adding a space at the start of a file causing all of the blocks to be misaligned?
The rsync paper https://www.andrew.cmu.edu/course/15-749/READINGS/required/c... is better than me at explaining this, but the rolling hash is the key to solving this misalignment problem that you describe. Essentially, using the rolling hash enables you to detect when a block as been misaligned (bytes added at the beginning of the file for example). There's no way to cause expensive resyncs in this case since it rolls over every byte in the file and reuses blocks on any alignment, even with data inserted in between.