Skip to content

Commit f8729d6

Browse files
committed
Handle invalid request in redirect function
1 parent bd81dc0 commit f8729d6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

kv/coordinator.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,10 @@ func (c *Coordinate) redirect(reqs *OperationGroup[OP]) (*CoordinateResponse, er
198198
return nil, errors.WithStack(err)
199199
}
200200

201+
if !r.Success {
202+
return nil, ErrInvalidRequest
203+
}
204+
201205
return &CoordinateResponse{
202206
CommitIndex: r.CommitIndex,
203207
}, nil

0 commit comments

Comments
 (0)