Skip to content

Commit

Permalink
Fix embarrassing bug in crash recovery.
Browse files Browse the repository at this point in the history
(And yes, we always knew we need tests for that. I have added a TODO now.)

Change-Id: I9cf52bbf98e263e0b79404bda4c442beba9696a8
  • Loading branch information
Bjoern Rabenstein committed Dec 17, 2014
1 parent d72d49f commit ff24070
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion storage/local/persistence.go
Original file line number Diff line number Diff line change
Expand Up @@ -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++ {
Expand Down

0 comments on commit ff24070

Please sign in to comment.