From 7ed8da1f44ed1197b1ef2490de7804ef6c10bff3 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 23 Sep 2019 10:57:28 -0500 Subject: [PATCH] mon/OSDMonitor: remove old removed_snap_ and removed_epoch_ keys 1- These aren't needed any more. 2- Prior to octopus, the removed_epoch_ epoch keys were merged into single records when they were contiguous, which meant they could consume a *lot* of space. Signed-off-by: Sage Weil --- src/mon/OSDMonitor.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 1abf3fa8b8f..b098ede29d2 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -101,7 +101,7 @@ static const string OSD_SNAP_PREFIX("osd_snap"); OSD snapshot metadata --------------------- - -- starting with mimic -- + -- starting with mimic, removed in octopus -- "removed_epoch_%llu_%08lx" % (pool, epoch) -> interval_set @@ -109,6 +109,9 @@ static const string OSD_SNAP_PREFIX("osd_snap"); "removed_snap_%llu_%016llx" % (pool, last_snap) -> { first_snap, end_snap, epoch } (last_snap = end_snap - 1) + + -- starting with mimic -- + "purged_snap_%llu_%016llx" % (pool, last_snap) -> { first_snap, end_snap, epoch } (last_snap = end_snap - 1) @@ -1887,6 +1890,11 @@ void OSDMonitor::encode_pending(MonitorDBStore::TransactionRef t) dout(10) << __func__ << " there were no pre-octopus purged snaps" << dendl; } + + // clean out the old removed_snap_ and removed_epoch keys + // ('`' is ASCII '_' + 1) + t->erase_range(OSD_SNAP_PREFIX, "removed_snap_", "removed_snap`"); + t->erase_range(OSD_SNAP_PREFIX, "removed_epoch_", "removed_epoch`"); } } -- 2.39.5