mirror of
https://github.com/ceph/ceph
synced 2025-02-21 09:57:26 +00:00
Merge pull request #12571 from athanatos/wip-15943
osd: Fix map gaps again (bug 15943) Reviewed-by: Brad Hubbard <bhubbard@redhat.com> Reviewed-by: Sage Weil <sage@redhat.com>
This commit is contained in:
commit
dc639fd9e5
@ -5,3 +5,4 @@ overrides:
|
||||
osd op queue: debug_random
|
||||
osd op queue cut off: debug_random
|
||||
osd debug verify missing on start: true
|
||||
osd debug verify cached snaps: true
|
||||
|
@ -18,6 +18,6 @@ tasks:
|
||||
- osd_map_cache_size
|
||||
- thrashosds:
|
||||
timeout: 1800
|
||||
chance_pgnum_grow: 1
|
||||
chance_pgpnum_fix: 1
|
||||
chance_test_map_discontinuity: 0.5
|
||||
chance_pgnum_grow: 0.25
|
||||
chance_pgpnum_fix: 0.25
|
||||
chance_test_map_discontinuity: 2
|
||||
|
@ -841,6 +841,7 @@ OPTION(osd_debug_reject_backfill_probability, OPT_DOUBLE, 0)
|
||||
OPTION(osd_debug_inject_copyfrom_error, OPT_BOOL, false) // inject failure during copyfrom completion
|
||||
OPTION(osd_debug_randomize_hobject_sort_order, OPT_BOOL, false)
|
||||
OPTION(osd_debug_misdirected_ops, OPT_BOOL, false)
|
||||
OPTION(osd_debug_verify_cached_snaps, OPT_BOOL, false)
|
||||
OPTION(osd_enable_op_tracker, OPT_BOOL, true) // enable/disable OSD op tracking
|
||||
OPTION(osd_num_op_tracker_shard, OPT_U32, 32) // The number of shards for holding the ops
|
||||
OPTION(osd_op_history_size, OPT_U32, 20) // Max number of completed ops to track
|
||||
|
@ -164,7 +164,7 @@ void PGPool::update(OSDMapRef map)
|
||||
auid = pi->auid;
|
||||
name = map->get_pool_name(id);
|
||||
bool updated = false;
|
||||
if ((map->get_epoch() == cached_epoch + 1) &&
|
||||
if ((map->get_epoch() != cached_epoch + 1) ||
|
||||
(pi->get_snap_epoch() == map->get_epoch())) {
|
||||
updated = true;
|
||||
pi->build_removed_snaps(newly_removed_snaps);
|
||||
@ -182,6 +182,16 @@ void PGPool::update(OSDMapRef map)
|
||||
}
|
||||
snapc = pi->get_snap_context();
|
||||
} else {
|
||||
/* 1) map->get_epoch() == cached_epoch + 1 &&
|
||||
* 2) pi->get_snap_epoch() != map->get_epoch()
|
||||
*
|
||||
* From the if branch, 1 && 2 must be true. From 2, we know that
|
||||
* this map didn't change the set of removed snaps. From 1, we
|
||||
* know that our cached_removed_snaps matches the previous map.
|
||||
* Thus, from 1 && 2, cached_removed snaps matches the current
|
||||
* set of removed snaps and all we have to do is clear
|
||||
* newly_removed_snaps.
|
||||
*/
|
||||
newly_removed_snaps.clear();
|
||||
}
|
||||
cached_epoch = map->get_epoch();
|
||||
@ -5694,6 +5704,19 @@ void PG::handle_advance_map(
|
||||
<< dendl;
|
||||
update_osdmap_ref(osdmap);
|
||||
pool.update(osdmap);
|
||||
if (cct->_conf->osd_debug_verify_cached_snaps) {
|
||||
interval_set<snapid_t> actual_removed_snaps;
|
||||
const pg_pool_t *pi = osdmap->get_pg_pool(info.pgid.pool());
|
||||
assert(pi);
|
||||
pi->build_removed_snaps(actual_removed_snaps);
|
||||
if (!(actual_removed_snaps == pool.cached_removed_snaps)) {
|
||||
derr << __func__ << ": mismatch between the actual removed snaps "
|
||||
<< actual_removed_snaps << " and pool.cached_removed_snaps "
|
||||
<< " pool.cached_removed_snaps " << pool.cached_removed_snaps
|
||||
<< dendl;
|
||||
}
|
||||
assert(actual_removed_snaps == pool.cached_removed_snaps);
|
||||
}
|
||||
AdvMap evt(
|
||||
osdmap, lastmap, newup, up_primary,
|
||||
newacting, acting_primary);
|
||||
|
Loading…
Reference in New Issue
Block a user