From ff24070a0387946687775daefdcc71d49d549c59 Mon Sep 17 00:00:00 2001 From: Bjoern Rabenstein Date: Wed, 17 Dec 2014 17:18:04 +0100 Subject: [PATCH] Fix embarrassing bug in crash recovery. (And yes, we always knew we need tests for that. I have added a TODO now.) Change-Id: I9cf52bbf98e263e0b79404bda4c442beba9696a8 --- storage/local/persistence.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/storage/local/persistence.go b/storage/local/persistence.go index f84ed1724..36674ef46 100644 --- a/storage/local/persistence.go +++ b/storage/local/persistence.go @@ -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++ {