Stop waiting for replica if generation changes
This commit is contained in:
10
replica.go
10
replica.go
@@ -1072,10 +1072,14 @@ func waitForReplica(ctx context.Context, r Replica, pos Pos) error {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
ready := true
|
// Exit if the generation has changed while waiting as there will be
|
||||||
|
// no further progress on the old generation.
|
||||||
if curr.Generation != pos.Generation {
|
if curr.Generation != pos.Generation {
|
||||||
ready = false
|
return fmt.Errorf("generation changed")
|
||||||
} else if curr.Index < pos.Index {
|
}
|
||||||
|
|
||||||
|
ready := true
|
||||||
|
if curr.Index < pos.Index {
|
||||||
ready = false
|
ready = false
|
||||||
} else if curr.Index == pos.Index && curr.Offset < pos.Offset {
|
} else if curr.Index == pos.Index && curr.Offset < pos.Offset {
|
||||||
ready = false
|
ready = false
|
||||||
|
|||||||
Reference in New Issue
Block a user