mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
lib/logstorage: postpone initialization of per-shard stateSizeBudget until the first call to pipeProcessor.writeBlock()
This simplifies pipeProcessor initialization logic a bit. This also doesn't mangle the original maxStateSize value, which is used in error messages when the state size exceeds maxStateSize.
This commit is contained in:
parent
dfcab4a47f
commit
94afcbd9a9
6 changed files with 5 additions and 18 deletions
|
@ -116,11 +116,9 @@ func newPipeSortProcessor(ps *pipeSort, workersCount int, stopCh <-chan struct{}
|
|||
for i := range shards {
|
||||
shards[i] = pipeSortProcessorShard{
|
||||
pipeSortProcessorShardNopad: pipeSortProcessorShardNopad{
|
||||
ps: ps,
|
||||
stateSizeBudget: stateSizeBudgetChunk,
|
||||
ps: ps,
|
||||
},
|
||||
}
|
||||
maxStateSize -= stateSizeBudgetChunk
|
||||
}
|
||||
|
||||
psp := &pipeSortProcessor{
|
||||
|
|
|
@ -20,11 +20,9 @@ func newPipeTopkProcessor(ps *pipeSort, workersCount int, stopCh <-chan struct{}
|
|||
for i := range shards {
|
||||
shards[i] = pipeTopkProcessorShard{
|
||||
pipeTopkProcessorShardNopad: pipeTopkProcessorShardNopad{
|
||||
ps: ps,
|
||||
stateSizeBudget: stateSizeBudgetChunk,
|
||||
ps: ps,
|
||||
},
|
||||
}
|
||||
maxStateSize -= stateSizeBudgetChunk
|
||||
}
|
||||
|
||||
ptp := &pipeTopkProcessor{
|
||||
|
|
|
@ -162,11 +162,8 @@ func (ps *pipeStats) newPipeProcessor(workersCount int, stopCh <-chan struct{},
|
|||
shards[i] = pipeStatsProcessorShard{
|
||||
pipeStatsProcessorShardNopad: pipeStatsProcessorShardNopad{
|
||||
ps: ps,
|
||||
|
||||
stateSizeBudget: stateSizeBudgetChunk,
|
||||
},
|
||||
}
|
||||
maxStateSize -= stateSizeBudgetChunk
|
||||
}
|
||||
|
||||
psp := &pipeStatsProcessor{
|
||||
|
|
|
@ -74,11 +74,9 @@ func (pc *pipeStreamContext) newPipeProcessor(workersCount int, stopCh <-chan st
|
|||
for i := range shards {
|
||||
shards[i] = pipeStreamContextProcessorShard{
|
||||
pipeStreamContextProcessorShardNopad: pipeStreamContextProcessorShardNopad{
|
||||
pc: pc,
|
||||
stateSizeBudget: stateSizeBudgetChunk,
|
||||
pc: pc,
|
||||
},
|
||||
}
|
||||
maxStateSize -= stateSizeBudgetChunk
|
||||
}
|
||||
|
||||
pcp := &pipeStreamContextProcessor{
|
||||
|
|
|
@ -79,11 +79,9 @@ func (pt *pipeTop) newPipeProcessor(workersCount int, stopCh <-chan struct{}, ca
|
|||
for i := range shards {
|
||||
shards[i] = pipeTopProcessorShard{
|
||||
pipeTopProcessorShardNopad: pipeTopProcessorShardNopad{
|
||||
pt: pt,
|
||||
stateSizeBudget: stateSizeBudgetChunk,
|
||||
pt: pt,
|
||||
},
|
||||
}
|
||||
maxStateSize -= stateSizeBudgetChunk
|
||||
}
|
||||
|
||||
ptp := &pipeTopProcessor{
|
||||
|
|
|
@ -74,11 +74,9 @@ func (pu *pipeUniq) newPipeProcessor(workersCount int, stopCh <-chan struct{}, c
|
|||
for i := range shards {
|
||||
shards[i] = pipeUniqProcessorShard{
|
||||
pipeUniqProcessorShardNopad: pipeUniqProcessorShardNopad{
|
||||
pu: pu,
|
||||
stateSizeBudget: stateSizeBudgetChunk,
|
||||
pu: pu,
|
||||
},
|
||||
}
|
||||
maxStateSize -= stateSizeBudgetChunk
|
||||
}
|
||||
|
||||
pup := &pipeUniqProcessor{
|
||||
|
|
Loading…
Reference in a new issue