]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/MonitorDBStore: assert/crash if there is a write error
authorSage Weil <sage@redhat.com>
Wed, 23 Sep 2015 14:58:13 +0000 (10:58 -0400)
committerNathan Cutler <ncutler@suse.com>
Sun, 27 Sep 2015 20:43:37 +0000 (22:43 +0200)
Do this globally intead of relying on teh zillion mon callers to
check the error code.  There are no cases where we want to
tolerate a commit failure.

Fixes: #13089
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 2fb7b1f0e33ada7c9a1be3de2f7708eb0760fcef)

src/mon/MonitorDBStore.h

index 1576db77d3c3d87545eb03769afb43729e9533a0..e10b786d0f23b0f51be9a608d39b32976b51103a 100644 (file)
@@ -283,6 +283,8 @@ class MonitorDBStore
          db->compact_range_async(compact.front().first, compact.front().second.first, compact.front().second.second);
        compact.pop_front();
       }
+    } else {
+      assert(0 == "failed to write to db");
     }
     return r;
   }
@@ -506,7 +508,8 @@ class MonitorDBStore
     for (iter = prefixes.begin(); iter != prefixes.end(); ++iter) {
       dbt->rmkeys_by_prefix((*iter));
     }
-    db->submit_transaction_sync(dbt);
+    int r = db->submit_transaction_sync(dbt);
+    assert(r >= 0);
   }
 
   void init_options() {