From da6aefa7e281b8ea8929b1e4242ff5148264f5ed Mon Sep 17 00:00:00 2001 From: Simone Gotti Date: Mon, 29 Apr 2019 10:16:19 +0200 Subject: [PATCH] runservice readdb: also resync changegroups --- .../services/runservice/scheduler/readdb/readdb.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/internal/services/runservice/scheduler/readdb/readdb.go b/internal/services/runservice/scheduler/readdb/readdb.go index 6dd6c02..b2f960b 100644 --- a/internal/services/runservice/scheduler/readdb/readdb.go +++ b/internal/services/runservice/scheduler/readdb/readdb.go @@ -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 continuation = nil 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 })