mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-12 14:27:27 -08:00
Allocate the shards only once while reading WAL (#6093)
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
This commit is contained in:
parent
493ef2f771
commit
53ea6d6390
|
@ -368,6 +368,7 @@ func (h *Head) loadWAL(r *wal.Reader, multiRef map[uint64]uint64) (err error) {
|
||||||
samples []record.RefSample
|
samples []record.RefSample
|
||||||
tstones []tombstones.Stone
|
tstones []tombstones.Stone
|
||||||
allStones = tombstones.NewMemTombstones()
|
allStones = tombstones.NewMemTombstones()
|
||||||
|
shards = make([][]record.RefSample, n)
|
||||||
)
|
)
|
||||||
defer func() {
|
defer func() {
|
||||||
if err := allStones.Close(); err != nil {
|
if err := allStones.Close(); err != nil {
|
||||||
|
@ -421,7 +422,6 @@ func (h *Head) loadWAL(r *wal.Reader, multiRef map[uint64]uint64) (err error) {
|
||||||
if len(samples) < m {
|
if len(samples) < m {
|
||||||
m = len(samples)
|
m = len(samples)
|
||||||
}
|
}
|
||||||
shards := make([][]record.RefSample, n)
|
|
||||||
for i := 0; i < n; i++ {
|
for i := 0; i < n; i++ {
|
||||||
var buf []record.RefSample
|
var buf []record.RefSample
|
||||||
select {
|
select {
|
||||||
|
|
Loading…
Reference in a new issue