]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mon/PGMonitor: reset in-core PGMap if on-disk format changes
authorSage Weil <sage@inktank.com>
Fri, 26 Jul 2013 22:25:12 +0000 (15:25 -0700)
committerSage Weil <sage@inktank.com>
Fri, 26 Jul 2013 22:25:30 +0000 (15:25 -0700)
commit6ac8aed040049358aaf8aee5cfb16791c4bb54a2
tree9a166ed6acc845659c45e1a6c3b52e7e995c6a51
parent10959404b30aa05c9d416b2a39aaae7d5641389a
mon/PGMonitor: reset in-core PGMap if on-disk format changes

We might have a sequence like:

- start mon, load pgmap 100
- sync
 - including a format upgrade at say v 150
- refresh
 - see format_version==1, and try read pgmap:101 as new format

This simply clears our in-memory state if we see that the format has
changed.  That will make update_from_paxos reload the latest and prevent
it from walking through the old and useless inc updates.

Note: this does not affect the auth monitor because we unconditionally
load the latest map in update_from_paxos on upgrade.  Also, the upgrade
there wasn't a format change--just a translation of cap strings from the
old to new style.

Fixes: #5764
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
src/mon/PGMonitor.cc
src/mon/PGMonitor.h
src/mon/PaxosService.cc
src/mon/PaxosService.h