]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
PrimaryLogPG: add assert that we aren't trimming past last_update_ondisk
authorSamuel Just <sjust@redhat.com>
Fri, 13 Mar 2020 22:43:58 +0000 (15:43 -0700)
committerxie xingguo <xie.xingguo@zte.com.cn>
Thu, 19 Mar 2020 00:14:53 +0000 (08:14 +0800)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/osd/PeeringState.h
src/osd/PrimaryLogPG.h

index 160ca0090e1b364792e017cfd0ce89ad2839f652..ede2258065b85b4abf587da70632ce65a84b7ea1 100644 (file)
@@ -2273,6 +2273,10 @@ public:
     return last_update_applied;
   }
 
+  eversion_t get_last_update_ondisk() const {
+    return last_update_ondisk;
+  }
+
   bool debug_has_dirty_state() const {
     return dirty_info || dirty_big_info;
   }
index fd303e2ac5440dc554db0a0954231f5db829c10d..afa54ab503adc21de938432b850fb7127fea3a72 100644 (file)
@@ -463,6 +463,9 @@ public:
     bool transaction_applied,
     ObjectStore::Transaction &t,
     bool async = false) override {
+    if (is_primary()) {
+      ceph_assert(trim_to <= recovery_state.get_last_update_ondisk());
+    }
     if (hset_history) {
       recovery_state.update_hset(*hset_history);
     }