mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Merge pull request #10623 from songjiayang/update-index
make sure response error when TOC parse failed
This commit is contained in:
commit
1f5934e7be
|
@ -175,18 +175,15 @@ func NewTOCFromByteSlice(bs ByteSlice) (*TOC, error) {
|
||||||
return nil, errors.Wrap(encoding.ErrInvalidChecksum, "read TOC")
|
return nil, errors.Wrap(encoding.ErrInvalidChecksum, "read TOC")
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := d.Err(); err != nil {
|
toc := &TOC{
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return &TOC{
|
|
||||||
Symbols: d.Be64(),
|
Symbols: d.Be64(),
|
||||||
Series: d.Be64(),
|
Series: d.Be64(),
|
||||||
LabelIndices: d.Be64(),
|
LabelIndices: d.Be64(),
|
||||||
LabelIndicesTable: d.Be64(),
|
LabelIndicesTable: d.Be64(),
|
||||||
Postings: d.Be64(),
|
Postings: d.Be64(),
|
||||||
PostingsTable: d.Be64(),
|
PostingsTable: d.Be64(),
|
||||||
}, nil
|
}
|
||||||
|
return toc, d.Err()
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewWriter returns a new Writer to the given filename. It serializes data in format version 2.
|
// NewWriter returns a new Writer to the given filename. It serializes data in format version 2.
|
||||||
|
|
Loading…
Reference in a new issue