mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 23:00:58 +00:00
744ef0d8ac
This makes version vector values clock based instead of just incremented from zero. The effect is that a vector that is created from scratch (after database reset) will have a higher value for the local device than what it could have been previously, causing a conflict. That is, if we are A and we had {A: 42, B: 12} in the old scheme, a reset and rescan would give us {A: 1} which is a strict ancestor of the older file (this might be wrong). With the new scheme we would instead have {A: someClockTime, b: otherClockTime} and the new version after reset would become {A: someClockTime+delta} which is in conflict with the previous entry (better). In case the clocks are wrong (current time is less than the value in the vector) we fall back to just simple increment like today. This scheme is ineffective if we suffer a database reset while at the same time setting the clock back far into the past. It's however no worse than what we already do. This loses the ability to emit the "added" event, as we can't look for the magic 1 entry any more. That event was however already broken (#5541). Another place where we infer meaning from the vector itself is in receive only folders, but there the only criteria is that the vector is one item long and includes just ourselves, which remains the case with this change. * wip |
||
---|---|---|
.. | ||
benchmark_test.go | ||
bep_extensions.go | ||
bep.pb.go | ||
bep.proto | ||
bufferpool_test.go | ||
bufferpool.go | ||
common_test.go | ||
compression_test.go | ||
compression.go | ||
conflict_test.go | ||
counting.go | ||
debug.go | ||
deviceid_test.go | ||
deviceid_test.pb.go | ||
deviceid_test.proto | ||
deviceid.go | ||
doc.go | ||
errors.go | ||
hello_test.go | ||
hello.go | ||
LICENSE | ||
luhn_test.go | ||
luhn.go | ||
nativemodel_darwin.go | ||
nativemodel_unix.go | ||
nativemodel_windows_test.go | ||
nativemodel_windows.go | ||
protocol_test.go | ||
protocol.go | ||
vector_test.go | ||
vector.go | ||
wireformat.go |