fix: ReportLog retry if noMore && more rows are to be sent
r.logOffset = ack
ack < r.logOffset+len(rows)
can be simplified as
len(rows) > 0
which is only false if there were no rows to send. It follows
that
if noMore && ack < r.logOffset+len(rows) {
is can be simplified as
if noMore {
is always true if rows were sent.
The intent was apparently to return on error and retry if only
part of the rows were sent but not all of them. To achieve that
the expression is replaced with:
if noMore && len(r.logRows) > 0 {
This commit is contained in:
parent
45fae19e5b
commit
b842a66be2
1 changed files with 1 additions and 1 deletions
|
|
@ -310,7 +310,7 @@ func (r *Reporter) ReportLog(noMore bool) error {
|
|||
r.logOffset = ack
|
||||
r.stateMu.Unlock()
|
||||
|
||||
if noMore && ack < r.logOffset+len(rows) {
|
||||
if noMore && len(r.logRows) > 0 {
|
||||
return NewErrRetry(errRetrySendAll, len(r.logRows))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue