mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-03-11 15:34:56 +00:00
app/{vminsert,vmstorage}: add comments on why storage.AddRows() is called without limiting the number of concurrent calls
This commit is contained in:
parent
5c4bd4f7c1
commit
293e4dc77b
3 changed files with 7 additions and 0 deletions
|
@ -144,6 +144,9 @@ func (ctx *InsertCtx) FlushBufs() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// There is no need in limiting the number of concurrent calls to vmstorage.AddRows() here,
|
||||||
|
// since the number of concurrent FlushBufs() calls should be already limited via writeconcurrencylimiter
|
||||||
|
// used at every ParseStream() call under lib/protoparser/*/streamparser.go
|
||||||
err := vmstorage.AddRows(ctx.mrs)
|
err := vmstorage.AddRows(ctx.mrs)
|
||||||
ctx.Reset(0)
|
ctx.Reset(0)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
|
|
@ -111,6 +111,8 @@ func pushAggregateSeries(tss []prompbmarshal.TimeSeries) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// There is no need in limiting the number of concurrent calls to vmstorage.AddRows() here,
|
||||||
|
// since the number of concurrent pushAggregateSeries() calls should be already limited by lib/streamaggr.
|
||||||
if err := vmstorage.AddRows(ctx.mrs); err != nil {
|
if err := vmstorage.AddRows(ctx.mrs); err != nil {
|
||||||
logger.Errorf("cannot flush aggregate series: %s", err)
|
logger.Errorf("cannot flush aggregate series: %s", err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -147,6 +147,8 @@ var WG syncwg.WaitGroup
|
||||||
var resetResponseCacheIfNeeded func(mrs []storage.MetricRow)
|
var resetResponseCacheIfNeeded func(mrs []storage.MetricRow)
|
||||||
|
|
||||||
// AddRows adds mrs to the storage.
|
// AddRows adds mrs to the storage.
|
||||||
|
//
|
||||||
|
// The caller should limit the number of concurrent calls to AddRows() in order to limit memory usage.
|
||||||
func AddRows(mrs []storage.MetricRow) error {
|
func AddRows(mrs []storage.MetricRow) error {
|
||||||
if Storage.IsReadOnly() {
|
if Storage.IsReadOnly() {
|
||||||
return errReadOnly
|
return errReadOnly
|
||||||
|
|
Loading…
Reference in a new issue