mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
lib/{mergeset,storage}: remove isInMerge flag from parts only when they werent removed yet from the list of active parts
This prevents from possible panic during access to pw.p when it is set to nil at partWrapper.decRef() called inside swapSrcWithDstParts()
This commit is contained in:
parent
88a4b9c313
commit
e0595af2bf
2 changed files with 2 additions and 2 deletions
|
@ -1072,7 +1072,6 @@ func (tb *Table) mergeParts(pws []*partWrapper, stopCh <-chan struct{}, isFinal
|
|||
// Nothing to merge.
|
||||
return errNothingToMerge
|
||||
}
|
||||
defer tb.releasePartsToMerge(pws)
|
||||
|
||||
startTime := time.Now()
|
||||
|
||||
|
@ -1132,6 +1131,7 @@ func (tb *Table) mergeParts(pws []*partWrapper, stopCh <-chan struct{}, isFinal
|
|||
putBlockStreamWriter(bsw)
|
||||
closeBlockStreamReaders()
|
||||
if err != nil {
|
||||
tb.releasePartsToMerge(pws)
|
||||
return err
|
||||
}
|
||||
if mpNew != nil {
|
||||
|
|
|
@ -1250,7 +1250,6 @@ func (pt *partition) mergeParts(pws []*partWrapper, stopCh <-chan struct{}, isFi
|
|||
// Nothing to merge.
|
||||
return errNothingToMerge
|
||||
}
|
||||
defer pt.releasePartsToMerge(pws)
|
||||
|
||||
startTime := time.Now()
|
||||
|
||||
|
@ -1311,6 +1310,7 @@ func (pt *partition) mergeParts(pws []*partWrapper, stopCh <-chan struct{}, isFi
|
|||
putBlockStreamWriter(bsw)
|
||||
closeBlockStreamReaders()
|
||||
if err != nil {
|
||||
pt.releasePartsToMerge(pws)
|
||||
return err
|
||||
}
|
||||
if mpNew != nil {
|
||||
|
|
Loading…
Reference in a new issue