mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-20 07:19:17 +01: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
a18d4f79d4
commit
b5d94f06f5
@ -117,10 +117,8 @@ func newPipeSortProcessor(ps *pipeSort, workersCount int, stopCh <-chan struct{}
|
||||
shards[i] = pipeSortProcessorShard{
|
||||
pipeSortProcessorShardNopad: pipeSortProcessorShardNopad{
|
||||
ps: ps,
|
||||
stateSizeBudget: stateSizeBudgetChunk,
|
||||
},
|
||||
}
|
||||
maxStateSize -= stateSizeBudgetChunk
|
||||
}
|
||||
|
||||
psp := &pipeSortProcessor{
|
||||
|
@ -21,10 +21,8 @@ func newPipeTopkProcessor(ps *pipeSort, workersCount int, stopCh <-chan struct{}
|
||||
shards[i] = pipeTopkProcessorShard{
|
||||
pipeTopkProcessorShardNopad: pipeTopkProcessorShardNopad{
|
||||
ps: ps,
|
||||
stateSizeBudget: stateSizeBudgetChunk,
|
||||
},
|
||||
}
|
||||
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{
|
||||
|
@ -75,10 +75,8 @@ func (pc *pipeStreamContext) newPipeProcessor(workersCount int, stopCh <-chan st
|
||||
shards[i] = pipeStreamContextProcessorShard{
|
||||
pipeStreamContextProcessorShardNopad: pipeStreamContextProcessorShardNopad{
|
||||
pc: pc,
|
||||
stateSizeBudget: stateSizeBudgetChunk,
|
||||
},
|
||||
}
|
||||
maxStateSize -= stateSizeBudgetChunk
|
||||
}
|
||||
|
||||
pcp := &pipeStreamContextProcessor{
|
||||
|
@ -80,10 +80,8 @@ func (pt *pipeTop) newPipeProcessor(workersCount int, stopCh <-chan struct{}, ca
|
||||
shards[i] = pipeTopProcessorShard{
|
||||
pipeTopProcessorShardNopad: pipeTopProcessorShardNopad{
|
||||
pt: pt,
|
||||
stateSizeBudget: stateSizeBudgetChunk,
|
||||
},
|
||||
}
|
||||
maxStateSize -= stateSizeBudgetChunk
|
||||
}
|
||||
|
||||
ptp := &pipeTopProcessor{
|
||||
|
@ -75,10 +75,8 @@ func (pu *pipeUniq) newPipeProcessor(workersCount int, stopCh <-chan struct{}, c
|
||||
shards[i] = pipeUniqProcessorShard{
|
||||
pipeUniqProcessorShardNopad: pipeUniqProcessorShardNopad{
|
||||
pu: pu,
|
||||
stateSizeBudget: stateSizeBudgetChunk,
|
||||
},
|
||||
}
|
||||
maxStateSize -= stateSizeBudgetChunk
|
||||
}
|
||||
|
||||
pup := &pipeUniqProcessor{
|
||||
|
Loading…
Reference in New Issue
Block a user