-
Notifications
You must be signed in to change notification settings - Fork 21
Description
Because most file sync protocols can process files in parallel and/or in random order, there is a race condition in the protocal, that might lead data not beeing synchronized.
The protocol specifies (and reference implementation implements): if the sequence file of an application indicates a change of an entry file, then the following will happen:
- Execute all the new entries.
- Update the sequences file in our local directory.
However, if the sequence file is synchronized and processed, before the corresponding entry file is synchronized the following will happen:
- No new entries will be found.
- The update of the sequence file in the local directory will prevent the (future) processing of the eventually updated entry file.
To my understanding this race condition cannot be detected with the current protocol version, because there is no link between entry sequence and entry contents. An extension of the protocol could make this race condition detectable by storing an entry file contents hash togehter with the sequence number in the apps sequence file. In this case the processig can be posponed until the entry files content hash matches the hash stored in the current sequence file.