mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-15 00:13:30 +01:00
app/vmagent: properly flush big blocks of data
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/741 Thanks to @IceRain00 for the investigation and initial attempt to fix the issue at https://github.com/VictoriaMetrics/VictoriaMetrics/pull/742
This commit is contained in:
parent
de216bab41
commit
a3cdef6b06
@ -126,9 +126,9 @@ func (wr *writeRequest) push(src []prompbmarshal.TimeSeries) {
|
|||||||
tssDst := wr.tss
|
tssDst := wr.tss
|
||||||
for i := range src {
|
for i := range src {
|
||||||
tssDst = append(tssDst, prompbmarshal.TimeSeries{})
|
tssDst = append(tssDst, prompbmarshal.TimeSeries{})
|
||||||
dst := &tssDst[len(tssDst)-1]
|
wr.copyTimeSeries(&tssDst[len(tssDst)-1], &src[i])
|
||||||
wr.copyTimeSeries(dst, &src[i])
|
if len(tssDst) >= maxRowsPerBlock {
|
||||||
if len(wr.tss) >= maxRowsPerBlock {
|
wr.tss = tssDst
|
||||||
wr.flush()
|
wr.flush()
|
||||||
tssDst = wr.tss
|
tssDst = wr.tss
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user