mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-10 23:54:05 -08:00
Merge pull request #469 from prometheus/beorn7/persistence
Remove check that did not check anything.
This commit is contained in:
commit
23f9279b9d
|
@ -1399,18 +1399,12 @@ func (p *persistence) openChunkFileForWriting(fp clientmodel.Fingerprint) (*os.F
|
||||||
if err := os.MkdirAll(p.dirNameForFingerprint(fp), 0700); err != nil {
|
if err := os.MkdirAll(p.dirNameForFingerprint(fp), 0700); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
f, err := os.OpenFile(p.fileNameForFingerprint(fp), os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0640)
|
return os.OpenFile(p.fileNameForFingerprint(fp), os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0640)
|
||||||
if err != nil {
|
// NOTE: Although the file was opened for append,
|
||||||
return f, err
|
// f.Seek(0, os.SEEK_CUR)
|
||||||
}
|
// would now return '0, nil', so we cannot check for a consistent file length right now.
|
||||||
offset, err := f.Seek(0, os.SEEK_CUR)
|
// However, the chunkIndexForOffset method is doing that check, so a wrong file length
|
||||||
if offset%int64(chunkHeaderLen+p.chunkLen) != 0 {
|
// would still be detected.
|
||||||
return f, fmt.Errorf(
|
|
||||||
"size of series file for fingerprint %v is %d, which is not a multiple of the chunk length %d",
|
|
||||||
fp, offset, chunkHeaderLen+p.chunkLen,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
return f, err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *persistence) openChunkFileForReading(fp clientmodel.Fingerprint) (*os.File, error) {
|
func (p *persistence) openChunkFileForReading(fp clientmodel.Fingerprint) (*os.File, error) {
|
||||||
|
|
Loading…
Reference in a new issue