Skip to content

Commit

Permalink
OSDMap: bump snap_epoch when adding a tier
Browse files Browse the repository at this point in the history
When we make an existing pool a tier, we start copying the snap metadata
from the base tier.  That includes removed_snaps.  In order for the OSD
to recognize that this value is changing for the first time, we need to
set snap_epoch, or else the OSD doesn't update it's in-memory PGPool
with removed snaps and we eventually hit an assertion failure because
PGPool::cached_remove_snaps is incorrect (e.g., empty).

Fix this by bumping snap_epoch when we add the new tier.

Fixes: ceph#7915
Signed-off-by: Sage Weil <[email protected]>
  • Loading branch information
Sage Weil committed Apr 2, 2014
1 parent 27e353c commit 6bf46e2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/mon/OSDMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4929,6 +4929,7 @@ bool OSDMonitor::prepare_command_impl(MMonCommand *m,
return true;
}
np->tiers.insert(tierpool_id);
np->set_snap_epoch(pending_inc.epoch); // tier will update to our snap info
ntp->tier_of = pool_id;
ss << "pool '" << tierpoolstr << "' is now (or already was) a tier of '" << poolstr << "'";
wait_for_finished_proposal(new Monitor::C_Command(mon, m, 0, ss.str(),
Expand Down Expand Up @@ -5176,6 +5177,7 @@ bool OSDMonitor::prepare_command_impl(MMonCommand *m,
return true;
}
np->tiers.insert(tierpool_id);
np->set_snap_epoch(pending_inc.epoch); // tier will update to our snap info
ntp->tier_of = pool_id;
ntp->cache_mode = mode;
ntp->hit_set_count = g_conf->osd_tier_default_cache_hit_set_count;
Expand Down

0 comments on commit 6bf46e2

Please sign in to comment.