Merge pull request #425 from prometheus/fix/series-file-name

Fix embarrassing bug in crash recovery.
This commit is contained in:
Björn Rabenstein 2014-12-17 18:37:00 +01:00
commit c4bcfeccc5

View file

@ -263,11 +263,12 @@ func (p *persistence) setDirty(dirty bool) {
// safe. Only call before anything else is running (except index processing
// queue as started by newPersistence).
func (p *persistence) recoverFromCrash(fingerprintToSeries map[clientmodel.Fingerprint]*memorySeries) error {
// TODO(beorn): We need proper tests for the crash recovery.
glog.Warning("Starting crash recovery. Prometheus is inoperational until complete.")
fpsSeen := map[clientmodel.Fingerprint]struct{}{}
count := 0
seriesDirNameFmt := fmt.Sprintf("0%dx", seriesDirNameLen)
seriesDirNameFmt := fmt.Sprintf("%%0%dx", seriesDirNameLen)
glog.Info("Scanning files.")
for i := 0; i < 1<<(seriesDirNameLen*4); i++ {