]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/MDSMonitor: return mon_mds_force_trim_to even if equal to current epoch
authorPatrick Donnelly <pdonnell@redhat.com>
Wed, 14 Jul 2021 20:31:21 +0000 (13:31 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Wed, 28 Jul 2021 14:07:05 +0000 (07:07 -0700)
The PaxosService code already excludes the value returned by
PaxosService::get_trim_to as the upper bound of the range of epochs to
trim. Without this fix, you need to set mon_mds_force_trim_to to one
greater than the epoch you want to trim _and_ force the current epoch to
be one greater than that; the net result being that you can only force
trimming up to 2 epochs behind the current epoch.

This change is helpful for resolving issue 51673, but not strictly
necessary.

Related-to: https://tracker.ceph.com/issues/51673
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/common/options/mon.yaml.in
src/mon/MDSMonitor.cc

index efeeea85dbf0c4a1bf8ca86471379f3f6490434b..526fc44607e8ee08b212045202f52b78f7da514b 100644 (file)
@@ -756,9 +756,10 @@ options:
 - name: mon_mds_force_trim_to
   type: int
   level: dev
-  desc: force mons to trim mdsmaps/fsmaps through this epoch
-  fmt_desc: Force monitor to trim mdsmaps to this point (0 disables it.
-    dangerous, use with care)
+  desc: force mons to trim mdsmaps/fsmaps up to this epoch
+  fmt_desc: Force monitor to trim mdsmaps up to but not including this FSMap
+    epoch. A value of 0 disables (the default) this config. This command is
+    potentially dangerous, use with care.
   default: 0
   services:
   - mon
index 8eb9910bf7db04fe157d7d02db560df82e30062b..c4cfe6c785534a178e277dc1bde1e1faa1f168ef 100644 (file)
@@ -290,7 +290,7 @@ version_t MDSMonitor::get_trim_to() const
 {
   version_t floor = 0;
   if (g_conf()->mon_mds_force_trim_to > 0 &&
-      g_conf()->mon_mds_force_trim_to < (int)get_last_committed()) {
+      g_conf()->mon_mds_force_trim_to <= (int)get_last_committed()) {
     floor = g_conf()->mon_mds_force_trim_to;
     dout(10) << __func__ << " explicit mon_mds_force_trim_to = "
              << floor << dendl;