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: v0.80.11~12^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d2bfa19077422eea37205fee9ed6fd5f2692f222;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 (cherry picked from commit 2fb7b1f0e33ada7c9a1be3de2f7708eb0760fcef) --- diff --git a/src/mon/MonitorDBStore.h b/src/mon/MonitorDBStore.h index 1576db77d3c3..e10b786d0f23 100644 --- a/src/mon/MonitorDBStore.h +++ b/src/mon/MonitorDBStore.h @@ -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() {