mirror of
https://github.com/syncthing/syncthing.git
synced 2024-11-17 02:48:57 -07: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 |
||
---|---|---|
.. | ||
testdata | ||
bytesemaphore_test.go | ||
bytesemaphore.go | ||
debug.go | ||
deviceactivity_test.go | ||
deviceactivity.go | ||
devicedownloadstate_test.go | ||
devicedownloadstate.go | ||
doc.go | ||
fakeconns_test.go | ||
folder_recvonly_test.go | ||
folder_recvonly.go | ||
folder_sendonly.go | ||
folder_sendrecv_test.go | ||
folder_sendrecv.go | ||
folder_summary.go | ||
folder_test.go | ||
folder.go | ||
folderstate.go | ||
model_test.go | ||
model.go | ||
progressemitter_test.go | ||
progressemitter.go | ||
queue_test.go | ||
queue.go | ||
requests_test.go | ||
sentdownloadstate.go | ||
sharedpullerstate_test.go | ||
sharedpullerstate.go | ||
testos_test.go | ||
testutils_test.go | ||
util.go | ||
utils_test.go |