]> 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)
committerSage Weil <sage@redhat.com>
Wed, 23 Sep 2015 14:58:13 +0000 (10:58 -0400)
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>
src/mon/MonitorDBStore.h

index 08f3233c79f5ca93c211d10d48695746e446a32e..6b1d6c85a74d0b9a2538e6f6a5d6ba3f261a4326 100644 (file)
@@ -301,6 +301,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;
   }
@@ -578,7 +580,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) {