Change minor things after code review.

This commit is contained in:
beorn7 2015-03-18 19:09:07 +01:00
parent 1a86dd3893
commit 1d8fc7d56f
4 changed files with 8 additions and 7 deletions

View file

@ -225,7 +225,9 @@ func (p *persistence) sanitizeSeries(
// Everything is consistent. We are good.
return fp, true
}
// If we are here, something's fishy.
// If we are here, we cannot be sure the series file is
// consistent with the checkpoint, so we have to take a closer
// look.
if s.headChunkClosed {
// This is the easy case as we don't have any chunks in
// heads.db. Treat this series as a freshly unarchived

View file

@ -911,7 +911,7 @@ func (p *persistence) dropAndPersistChunks(
// Otherwise, seek backwards to the beginning of its header and start
// copying everything from there into a new file. Then append the chunks
// to the new file.
_, err = f.Seek(-(chunkHeaderLen), os.SEEK_CUR)
_, err = f.Seek(-chunkHeaderLen, os.SEEK_CUR)
if err != nil {
return
}

View file

@ -32,7 +32,6 @@ const (
chunkDescEvictionFactor = 10
headChunkTimeout = time.Hour // Close head chunk if not touched for that long.
)
// fingerprintSeriesPair pairs a fingerprint with a memorySeries pointer.
@ -168,7 +167,7 @@ type memorySeries struct {
// appended.
headChunkUsedByIterator bool
// Whether the series is inconsistent with the last checkpoint in a way
// that would require a desk seek during crash recovery.
// that would require a disk seek during crash recovery.
dirty bool
}
@ -233,7 +232,7 @@ func (s *memorySeries) add(v *metric.SamplePair) int {
}
// maybeCloseHeadChunk closes the head chunk if it has not been touched for the
// duration of headChunkTimeout. It returns wether the head chunk was closed.
// duration of headChunkTimeout. It returns whether the head chunk was closed.
// If the head chunk is already closed, the method is a no-op and returns false.
//
// The caller must have locked the fingerprint of the series.

View file

@ -803,8 +803,8 @@ func (s *memorySeriesStorage) maintainMemorySeries(
}
// writeMemorySeries (re-)writes a memory series file. While doing so, it drops
// chunks older than beforeTime from both, the series file (if it exists) as
// well as from memory. The provided chunksToPersist are appended to the newly
// chunks older than beforeTime from both the series file (if it exists) as well
// as from memory. The provided chunksToPersist are appended to the newly
// written series file. If no chunks need to be purged, but chunksToPersist is
// not empty, those chunks are simply appended to the series file. If the series
// contains no chunks after dropping old chunks, it is purged entirely. In that