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
2fd9fdacce
commit
67df75484f
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.
|
// Nothing to merge.
|
||||||
return errNothingToMerge
|
return errNothingToMerge
|
||||||
}
|
}
|
||||||
defer tb.releasePartsToMerge(pws)
|
|
||||||
|
|
||||||
startTime := time.Now()
|
startTime := time.Now()
|
||||||
|
|
||||||
|
@ -1132,6 +1131,7 @@ func (tb *Table) mergeParts(pws []*partWrapper, stopCh <-chan struct{}, isFinal
|
||||||
putBlockStreamWriter(bsw)
|
putBlockStreamWriter(bsw)
|
||||||
closeBlockStreamReaders()
|
closeBlockStreamReaders()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
tb.releasePartsToMerge(pws)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if mpNew != nil {
|
if mpNew != nil {
|
||||||
|
|
|
@ -1250,7 +1250,6 @@ func (pt *partition) mergeParts(pws []*partWrapper, stopCh <-chan struct{}, isFi
|
||||||
// Nothing to merge.
|
// Nothing to merge.
|
||||||
return errNothingToMerge
|
return errNothingToMerge
|
||||||
}
|
}
|
||||||
defer pt.releasePartsToMerge(pws)
|
|
||||||
|
|
||||||
startTime := time.Now()
|
startTime := time.Now()
|
||||||
|
|
||||||
|
@ -1311,6 +1310,7 @@ func (pt *partition) mergeParts(pws []*partWrapper, stopCh <-chan struct{}, isFi
|
||||||
putBlockStreamWriter(bsw)
|
putBlockStreamWriter(bsw)
|
||||||
closeBlockStreamReaders()
|
closeBlockStreamReaders()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
pt.releasePartsToMerge(pws)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if mpNew != nil {
|
if mpNew != nil {
|
||||||
|
|
Loading…
Reference in a new issue