mon: fix osdmap trimming unsigned overflow

This was trimming way to aggressively for early epochs due to the unsigned
version overflowing.

Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
Sage Weil 2011-10-06 16:00:34 -07:00
parent 4fe9cca5dd
commit 6e04f60ed4

View File

@ -1113,7 +1113,8 @@ void OSDMonitor::tick()
mon->pgmon()->pg_map.creating_pgs.empty()) {
epoch_t floor = mon->pgmon()->pg_map.calc_min_last_epoch_clean();
dout(10) << " min_last_epoch_clean " << floor << dendl;
if (floor < paxos->get_version() - 10) {
unsigned min = 100;
if (floor + min < paxos->get_version()) {
epoch_t of = paxos->get_first_committed();
paxos->trim_to(floor);
while (of < floor) {