fix: stop row isolation after ambiguous send
This commit is contained in:
+9
-1
@@ -431,12 +431,20 @@ func Flush(ctx context.Context, conn BatchPreparer, entries []*LogEntry) FlushRe
|
||||
}
|
||||
|
||||
combined := FlushResult{}
|
||||
for _, entry := range entries {
|
||||
for i, entry := range entries {
|
||||
single := flushOnce(ctx, conn, []*LogEntry{entry}).public([]*LogEntry{entry})
|
||||
combined.Retry = append(combined.Retry, single.Retry...)
|
||||
combined.Failed += single.Failed
|
||||
combined.Ambiguous += single.Ambiguous
|
||||
combined.Err = errors.Join(combined.Err, single.Err)
|
||||
if single.Ambiguous > 0 {
|
||||
if backend, ok := conn.(interface{ MarkUnhealthy() }); ok {
|
||||
backend.MarkUnhealthy()
|
||||
}
|
||||
combined.Failed += len(combined.Retry) + len(entries) - i - 1
|
||||
combined.Retry = nil
|
||||
break
|
||||
}
|
||||
}
|
||||
return combined
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user