From: Sage Weil Date: Wed, 23 Sep 2015 14:58:13 +0000 (-0400) Subject: mon/MonitorDBStore: assert/crash if there is a write error X-Git-Tag: v9.1.0~76^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2fb7b1f0e33ada7c9a1be3de2f7708eb0760fcef;p=ceph.git mon/MonitorDBStore: assert/crash if there is a write error 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 --- diff --git a/src/mon/MonitorDBStore.h b/src/mon/MonitorDBStore.h index 08f3233c79f5c..6b1d6c85a74d0 100644 --- a/src/mon/MonitorDBStore.h +++ b/src/mon/MonitorDBStore.h @@ -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) {