fix: stop row isolation after ambiguous send

This commit is contained in:
MiMoCode
2026-07-10 19:34:56 +08:00
parent 3717632f27
commit f27382c33a
2 changed files with 36 additions and 5 deletions
+9 -1
View File
@@ -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
}