From 34c2f6a44c871c06caeec69b9aa749c1dfc60528 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sun, 23 Oct 2011 16:16:03 -0700 Subject: [PATCH] osd: pg_pool_t: set crash_replay_interval on data pool when decoding old We want to preserve the crash_replay_interval on old clusters being upgraded. Kludge this by setting it to 60 (the old default) if the crush_ruleset == 0 and owner == 0, which is normally true for just the data pool. This may catch other pools they created by hand, but it's still better than having the replay interval for all pools when it is not needed. Signed-off-by: Sage Weil --- src/osd/osd_types.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/osd/osd_types.cc b/src/osd/osd_types.cc index aa8210b562aa8..262292d705420 100644 --- a/src/osd/osd_types.cc +++ b/src/osd/osd_types.cc @@ -483,7 +483,15 @@ void pg_pool_t::decode(bufferlist::iterator& bl) ::decode(crash_replay_interval, bl); } else { flags = 0; - crash_replay_interval = 0; + + // if this looks like the 'data' pool, set the + // crash_replay_interval appropriately. unfortunately, we can't + // be precise here. this should be good enough to preserve replay + // on the data pool for the majority of cluster upgrades, though. + if (crush_ruleset == 0 && auid == 0) + crash_replay_interval = 60; + else + crash_replay_interval = 0; } calc_pg_masks(); -- 2.39.5