runservice readdb: also resync changegroups

This commit is contained in:
Simone Gotti 2019-04-29 10:16:19 +02:00
parent 19877e679c
commit da6aefa7e2
1 changed files with 13 additions and 1 deletions

View File

@ -222,7 +222,7 @@ func (r *ReadDB) SyncRDB(ctx context.Context) error {
} }
} }
// use the same revision // sync changegroups, use the same revision of previous operations
key = common.EtcdChangeGroupsDir key = common.EtcdChangeGroupsDir
continuation = nil continuation = nil
for { for {
@ -627,6 +627,18 @@ func (r *ReadDB) SyncObjectStorage(ctx context.Context) error {
} }
} }
// sync changegroups, use the same revision of previous operations
changeGroupsRevisions, err := r.dm.ListEtcdChangeGroups(ctx, revision)
if err != nil {
return err
}
for changeGroupID, changeGroupRevision := range changeGroupsRevisions {
if err := r.insertChangeGroupRevisionOST(tx, changeGroupID, changeGroupRevision); err != nil {
return err
}
}
return nil return nil
}) })