]> git.apps.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 23:11:51 +0000 (16:11 -0700)
commit7fb3804fb860dcd0340dd3f7c39eec4315f8e4b6
treef314ff52a48404e432f178f2fe81d0cf1fa35bea
parent24f90b832c695ef13021db66a178c18369ac356d
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>
(cherry picked from commit afd6c7d8247075003e5be439ad59976c3d123218)
src/mon/OSDMonitor.cc
src/mon/OSDMonitor.h
src/mon/PaxosService.cc
src/mon/PaxosService.h