]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: pg_pool_t: set crash_replay_interval on data pool when decoding old
authorSage Weil <sage@newdream.net>
Sun, 23 Oct 2011 23:16:03 +0000 (16:16 -0700)
committerSage Weil <sage@newdream.net>
Mon, 24 Oct 2011 00:13:00 +0000 (17:13 -0700)
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 <sage@newdream.net>
src/osd/osd_types.cc

index aa8210b562aa84b441267c3f3061afacbc2f4c33..262292d705420e88f656ff886453e05b161b54a5 100644 (file)
@@ -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();