From: Sage Weil Date: Sun, 23 Oct 2011 23:16:03 +0000 (-0700) Subject: osd: pg_pool_t: set crash_replay_interval on data pool when decoding old X-Git-Tag: v0.38~57^2~2^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=34c2f6a44c871c06caeec69b9aa749c1dfc60528;p=ceph.git 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 --- diff --git a/src/osd/osd_types.cc b/src/osd/osd_types.cc index aa8210b562aa..262292d70542 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();