From 566f6558b4060c85fc5525ae28a46126c2f37ec3 Mon Sep 17 00:00:00 2001 From: Philip O'Toole Date: Thu, 9 Apr 2015 11:06:41 -0700 Subject: [PATCH] Persist term to disk when it changes --- CHANGELOG.md | 1 + raft/log.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f178cf32a51..d6240bf1120 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ - [#2200](https://github.com/influxdb/influxdb/pull/2200): Re-enable Continuous Queries. - [#2203](https://github.com/influxdb/influxdb/pull/2203): Fix race condition on continuous queries. - [#2217](https://github.com/influxdb/influxdb/pull/2217): Only revert to follower if new term is greater. +- [#2219](https://github.com/influxdb/influxdb/pull/2219): Persist term change to disk when candidate. Thanks @cannium ## v0.9.0-rc20 [2015-04-04] diff --git a/raft/log.go b/raft/log.go index 4c22d4eaaa7..3591ffd52a1 100644 --- a/raft/log.go +++ b/raft/log.go @@ -960,7 +960,7 @@ func (l *Log) candidateLoop(closing <-chan struct{}) State { // Increment term and request votes. l.mu.Lock() - l.term++ + l.mustSetTerm(l.term + 1) l.votedFor = l.id term := l.term l.mu.Unlock()