1.8 KiB
1.8 KiB
Sync Algorithm V3
Drafted on 20240117.
An absolutely better sync algorithm. Better for tracking deletions and better for subbranching.
Huge Thanks
Basically a combination of algorithm v2 + synclone + rsinc + (some of rclone bisync). All of the later three are released under MIT License so no worries about the licenses.
Features
Must have
- true deletion detection
- deletion protection (blocking) with a setting
- transaction from the old algorithm
- user warning show up, new algorithm needs all clients to be updated! (deliberately corrput the metadata file??)
- filters
- conflict warning
- partial sync
Nice to have
- true time and hash
- conflict rename
Description
We have five input sources:
- local all files
- remote all files
- local previous succeeded sync history
- local deletions
- remote deletions.
Init run, consuming remote deletions :
TBD
Later runs, use the first, second, third sources only.
Table modified based on synclone and rsinc. The number inside the table cell is the decision branch in the code.
| local\remote | remote unchanged | remote modified | remote deleted | remote created |
|---|---|---|---|---|
| local unchanged | (02) do nothing | (09) pull remote | (07) delete local | (??) conflict |
| local modified | (10) push local | (12) conflict | (08) push local | (??) conflict |
| local deleted | (04) delete remote | (05) pull | (01) clean history | (03) pull remote |
| local created | (??) conflict | (??) conflict | (06) push local | (11) conflict |