Fix issues when persistence enabled 67/44567/1
authorTom Pantelis <tpanteli@brocade.com>
Mon, 22 Aug 2016 21:32:59 +0000 (17:32 -0400)
committerTom Pantelis <tpanteli@brocade.com>
Tue, 23 Aug 2016 19:23:58 +0000 (19:23 +0000)
When persistence is dynamically enabled, we start persisting subsequent log
entries which causes issues on restart due to a gap in journal indexes. We need to
persist a snapshot with the current state to avoid this.

Also if persistence is disabled, we still persist ReplicatedLogEntry instances that
have a PersistentPayload, of which ServerConfigurationPayload is currently the only one.
This also can cause gaps in the persisted journal indexes which cause issues if
persistence is later enabled. To avoid this, we really shouldn't persist
ReplicatedLogEntry instances at all if data persistence is disabled since we don't
add them to the in-memory journal on recovery anyway - we just recover and apply the
ServerConfigurationPayload. Instead we should persist just the
ServerConfigurationPayload.

Change-Id: Ief78d68423b33aac1649220a36d32ff50f493eb7
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
(cherry picked from commit c42a5e91e0dcfc499b33a321ef45c0d310d366cc)


No differences found