Skip to content

Commit 499f452

Browse files
committed
rpcserver: when removing fed server also remove from proof sync log
1 parent 14a653e commit 499f452

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

rpcserver.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3997,7 +3997,17 @@ func (r *rpcServer) DeleteFederationServer(ctx context.Context,
39973997

39983998
serversToDel := fn.Map(req.Servers, unmarshalUniverseServer)
39993999

4000-
err := r.cfg.FederationDB.RemoveServers(ctx, serversToDel...)
4000+
// Remove the servers from the proofs sync log. This is necessary before
4001+
// we can remove the servers from the database because of a foreign
4002+
// key constraint.
4003+
err := r.cfg.FederationDB.DeleteProofsSyncLogEntries(
4004+
ctx, serversToDel...,
4005+
)
4006+
if err != nil {
4007+
return nil, err
4008+
}
4009+
4010+
err = r.cfg.FederationDB.RemoveServers(ctx, serversToDel...)
40014011
if err != nil {
40024012
return nil, err
40034013
}

0 commit comments

Comments
 (0)