unsigned new_pg_num = nextmap->get_pg_num(pg->pg_id.pool());
unsigned split_bits = pg->pg_id.get_split_bits(new_pg_num);
dout(1) << __func__ << " merging " << pg->pg_id << dendl;
- pg->merge_from(sources, rctx, split_bits);
+ pg->merge_from(
+ sources, rctx, split_bits,
+ nextmap->get_pg_pool(
+ pg->pg_id.pool())->get_pg_num_dec_last_epoch_clean());
pg->pg_slot->waiting_for_merge_epoch = 0;
} else {
dout(20) << __func__ << " not ready to merge yet" << dendl;
}
void PG::merge_from(map<spg_t,PGRef>& sources, RecoveryCtx *rctx,
- unsigned split_bits)
+ unsigned split_bits,
+ epoch_t dec_last_epoch_clean)
{
dout(10) << __func__ << " from " << sources << " split_bits " << split_bits
<< dendl;
// make sure we have a meaningful last_epoch_started/clean (if we were a
// placeholder)
if (info.last_epoch_started == 0) {
+ // we use the pg_num_dec_last_epoch_clean we got from the caller, which is
+ // the epoch that was clean according to the target pg whe it requested
+ // the mon decrement pg_num.
info.history.last_epoch_started =
- info.history.last_epoch_clean = past_intervals.get_bounds().first;
+ info.history.last_epoch_clean = dec_last_epoch_clean;
dout(10) << __func__
<< " set last_epoch_started/clean based on past intervals"
<< dendl;
ObjectStore::Transaction *t) = 0;
void split_into(pg_t child_pgid, PG *child, unsigned split_bits);
void merge_from(map<spg_t,PGRef>& sources, RecoveryCtx *rctx,
- unsigned split_bits);
+ unsigned split_bits,
+ epoch_t dec_last_epoch_clean);
void finish_split_stats(const object_stat_sum_t& stats, ObjectStore::Transaction *t);
void scrub(epoch_t queued, ThreadPool::TPHandle &handle);