Cap the number of maps we delete on each pass through handle_osd_map. As
long as the target transaction size is larger than the number of maps we
get in each message, we'll be fine. Ensure we at least keep pace with
incoming maps in case those values' relative sizes nave flipped.
Fixes: #2856
Signed-off-by: Sage Weil <sage@inktank.com>
}
if (superblock.oldest_map) {
+ int num = 0;
for (epoch_t e = superblock.oldest_map; e < m->oldest_map; ++e) {
dout(20) << " removing old osdmap epoch " << e << dendl;
t.remove(coll_t::META_COLL, get_osdmap_pobject_name(e));
t.remove(coll_t::META_COLL, get_inc_osdmap_pobject_name(e));
superblock.oldest_map = e+1;
+ num++;
+ if (num >= g_conf->osd_target_transaction_size &&
+ num > (last - first)) // make sure we at least keep pace with incoming maps
+ break;
}
}