cmd/syncthing, lib/db: Be nicer about dropping deltas on upgrade (#4798)
When dropping delta index IDs due to upgrade, only drop our local one. Previously, when dropping all of them, we would trigger a full send in both directions on first connect after upgrade. Then the other side would upgrade, doing the same thing. Net effect is full index data gets sent twice in both directions. With this change we just drop our local ID, meaning we will send our full index on first connect after upgrade. When the other side upgrades, they will do the same. This is a bit less cruel.
This commit is contained in:
@@ -726,7 +726,8 @@ func syncthingMain(runtimeOptions RuntimeOptions) {
|
||||
|
||||
if runtimeOptions.resetDeltaIdxs {
|
||||
l.Infoln("Reinitializing delta index IDs")
|
||||
ldb.DropDeltaIndexIDs()
|
||||
ldb.DropLocalDeltaIndexIDs()
|
||||
ldb.DropRemoteDeltaIndexIDs()
|
||||
}
|
||||
|
||||
protectedFiles := []string{
|
||||
@@ -762,8 +763,8 @@ func syncthingMain(runtimeOptions RuntimeOptions) {
|
||||
}
|
||||
|
||||
// Drop delta indexes in case we've changed random stuff we
|
||||
// shouldn't have.
|
||||
ldb.DropDeltaIndexIDs()
|
||||
// shouldn't have. We will resend our index on next connect.
|
||||
ldb.DropLocalDeltaIndexIDs()
|
||||
|
||||
// Remember the new version.
|
||||
miscDB.PutString("prevVersion", Version)
|
||||
|
||||
Reference in New Issue
Block a user