]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mon: fix osdmap stash, trim to retain complete history of full maps
authorSage Weil <sage@inktank.com>
Mon, 8 Jul 2013 22:04:59 +0000 (15:04 -0700)
committerSage Weil <sage@inktank.com>
Mon, 8 Jul 2013 22:04:59 +0000 (15:04 -0700)
commitafd6c7d8247075003e5be439ad59976c3d123218
tree568203307cfe70ac0d663788521e1337c3f8fb77
parent9f8bfb4b22554e85c4385840ac5c850c68456c14
mon: fix osdmap stash, trim to retain complete history of full maps

The current interaction between sync and stashing full osdmaps only on
active mons means that a sync can result in an incomplete osdmap_full
history:

 - mon.c starts a full sync
 - during sync, active osdmap service should_stash_full() is true and
   includes a full in the txn
 - mon.c sync finishes
 - mon.c update_from_paxos gets "latest" stashed that it got from the
   paxos txn
 - mon.c does *not* walk to previous inc maps to complete it's collection
   of full maps.

To fix this, we disable the periodic/random stash of full maps by the
osdmap service.

This introduces a new problem: we must have at least one full map (the first
one) in order for a mon that just synced to build it's full collection.
Extend the encode_trim() process to allow the osdmap service to include
the oldest full map with the trim txn.  This is more complex than just
writing the full maps in the txn, but cheaper--we only write the full
map at trim time.

This *might* be related to previous bugs where the full osdmap was
missing, or case where leveldb keys seemed to 'disappear'.

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