mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
lib/storage: mention source parts on merge error
This should improve determining broken source part. Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/76
This commit is contained in:
parent
61926bae01
commit
af2ceaaa0b
3 changed files with 9 additions and 2 deletions
|
@ -91,6 +91,13 @@ func (bsr *blockStreamReader) reset() {
|
||||||
bsr.err = nil
|
bsr.err = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (bsr *blockStreamReader) String() string {
|
||||||
|
if len(bsr.path) > 0 {
|
||||||
|
return bsr.path
|
||||||
|
}
|
||||||
|
return bsr.ph.String()
|
||||||
|
}
|
||||||
|
|
||||||
// InitFromInmemoryPart initializes bsr from the given ip.
|
// InitFromInmemoryPart initializes bsr from the given ip.
|
||||||
func (bsr *blockStreamReader) InitFromInmemoryPart(ip *inmemoryPart) {
|
func (bsr *blockStreamReader) InitFromInmemoryPart(ip *inmemoryPart) {
|
||||||
bsr.reset()
|
bsr.reset()
|
||||||
|
|
|
@ -29,7 +29,7 @@ func mergeBlockStreams(ph *partHeader, bsw *blockStreamWriter, bsrs []*blockStre
|
||||||
if err == errForciblyStopped {
|
if err == errForciblyStopped {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return fmt.Errorf("cannot merge block streams: %s", err)
|
return fmt.Errorf("cannot merge %d block streams: %s: %s", len(bsrs), bsrs, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
var bsmPool = &sync.Pool{
|
var bsmPool = &sync.Pool{
|
||||||
|
|
|
@ -29,7 +29,7 @@ func mergeBlockStreams(ph *partHeader, bsw *blockStreamWriter, bsrs []*blockStre
|
||||||
if err == errForciblyStopped {
|
if err == errForciblyStopped {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return fmt.Errorf("cannot merge %d streams: %s", len(bsrs), err)
|
return fmt.Errorf("cannot merge %d streams: %s: %s", len(bsrs), bsrs, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
var bsmPool = &sync.Pool{
|
var bsmPool = &sync.Pool{
|
||||||
|
|
Loading…
Reference in a new issue