]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
osd/PG: align past_intervals and last_epoch_clean for fabricated merge target
authorSage Weil <sage@redhat.com>
Thu, 20 Dec 2018 14:59:55 +0000 (08:59 -0600)
committerSage Weil <sage@redhat.com>
Thu, 20 Dec 2018 14:59:55 +0000 (08:59 -0600)
commitb79442efce479fde7f8bda8fdadf86e91003a327
tree7a85a5f676fed7e91757832338ddb5ceedb24fd2
parent70ca0ea335a8db7b5e589f434ce23f55a50ed81e
osd/PG: align past_intervals and last_epoch_clean for fabricated merge target

When we are fabricating a merge target, we have to construct a
meaningful pg_history_t and PastIntervals.  We do this with
pieces of the source PG and the last_epoch_clean and
last_epoch_started values from the pg_pool_t.  This usually
works, except when

 - source and target become clean, and we decrement pg_num
 - OSD mapping changes (for source and target)
 - source repeers, but target does not
 - OSD with source only tries to merge

In this case, the source will have a past_intervals start that is
later than the last_epoch_clean implied in the pg_pool_t.

This situation is harmless because we do not allow the actual
mappings of source and target to diverge during the merge window,
so if the source's past intervals was adjusted we can still use
it.  Avoid logging errors by adjusting the start epoch backwards.

Fixes: http://tracker.ceph.com/issues/37511
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/PG.cc
src/osd/osd_types.cc
src/osd/osd_types.h