fix(write): Successful writes increment write error statistics incorrectly.

In v1.8.3 and earlier, the write path through (*PointsWriter) writeToShardWithContext() always increments the WriteErr count in the debug variables, and does not increment the WriteOK count.
https://github.com/influxdata/influxdb/blob/v1.8.3/coordinator/points_writer.go line 450 should be an else if err != nil { instead of an else
This has been reported in a customer cloud instance, and verified under a debugger.

https://github.com/influxdata/influxdb/issues/20098
pull/20100/head
davidby-influx 2020-11-18 19:39:42 -08:00
parent af00cb7bbd
commit 3d9f8b5020
1 changed files with 1 additions and 2 deletions

View File

@ -447,11 +447,10 @@ func (w *PointsWriter) writeToShardWithContext(ctx context.Context, shard *meta.
atomic.AddInt64(&w.stats.WriteErr, 1)
return err
}
} else {
} else if err != nil {
atomic.AddInt64(&w.stats.WriteErr, 1)
return err
}
atomic.AddInt64(&w.stats.WriteOK, 1)
return nil
}