diff --git a/replica.go b/replica.go index 7d4f70ef..90877c76 100644 --- a/replica.go +++ b/replica.go @@ -238,6 +238,12 @@ func (r *Replica) syncWAL(ctx context.Context) (err error) { var g errgroup.Group g.Go(func() error { _, err := r.Client.WriteWALSegment(ctx, pos, pr) + + // Always close pipe reader to signal writers. + if e := pr.CloseWithError(err); err == nil { + return e + } + return err })