]> git.apps.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)
committerLoic Dachary <ldachary@redhat.com>
Fri, 2 Oct 2015 10:49:04 +0000 (12:49 +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 e37b95db9008584e8113b45e81b70476dc8665f1..2e66a301383dddbdbf9f941561e5de4582778dee 100644 (file)
@@ -291,6 +291,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;
   }
@@ -564,7 +566,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);
   }
 
   int open(ostream &out) {