From: David Zafman Date: Mon, 3 Apr 2017 23:20:35 +0000 (-0700) Subject: osd: Check failsafe full and crash on push/pull X-Git-Tag: v12.0.2~51^2~10 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=1711ccdec779d32c4b128c1e3f6d10bd78abcb1c;p=ceph.git osd: Check failsafe full and crash on push/pull Signed-off-by: David Zafman --- diff --git a/src/osd/ECBackend.cc b/src/osd/ECBackend.cc index 8e7b09fe38aec..ea285cc4e6f44 100644 --- a/src/osd/ECBackend.cc +++ b/src/osd/ECBackend.cc @@ -282,6 +282,11 @@ void ECBackend::handle_recovery_push( const PushOp &op, RecoveryMessages *m) { + ostringstream ss; + if (get_parent()->check_failsafe_full(ss)) { + dout(10) << __func__ << " Out of space (failsafe) processing push request: " << ss.str() << dendl; + ceph_abort(); + } bool oneshot = op.before_progress.first && op.after_progress.data_complete; ghobject_t tobj; diff --git a/src/osd/PGBackend.h b/src/osd/PGBackend.h index 763e02bc2b8a9..ddd0612b1313c 100644 --- a/src/osd/PGBackend.h +++ b/src/osd/PGBackend.h @@ -261,6 +261,8 @@ typedef ceph::shared_ptr OSDMapRef; virtual LogClientTemp clog_error() = 0; + virtual bool check_failsafe_full(ostream &ss) = 0; + virtual ~Listener() {} }; Listener *parent; diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 5a73ca5e98206..9398783d86701 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -13272,6 +13272,10 @@ int PrimaryLogPG::getattrs_maybe_cache( return r; } +bool PrimaryLogPG::check_failsafe_full(ostream &ss) { + return osd->check_failsafe_full(ss); +} + void intrusive_ptr_add_ref(PrimaryLogPG *pg) { pg->get("intptr"); } void intrusive_ptr_release(PrimaryLogPG *pg) { pg->put("intptr"); } diff --git a/src/osd/PrimaryLogPG.h b/src/osd/PrimaryLogPG.h index 3d92e3b968cdb..f5b025db0e4fd 100644 --- a/src/osd/PrimaryLogPG.h +++ b/src/osd/PrimaryLogPG.h @@ -1731,6 +1731,7 @@ public: void on_flushed() override; void on_removal(ObjectStore::Transaction *t) override; void on_shutdown() override; + bool check_failsafe_full(ostream &ss) override; // attr cache handling void setattr_maybe_cache( diff --git a/src/osd/ReplicatedBackend.cc b/src/osd/ReplicatedBackend.cc index b897eddf8157e..1364cc6277025 100644 --- a/src/osd/ReplicatedBackend.cc +++ b/src/osd/ReplicatedBackend.cc @@ -807,6 +807,11 @@ void ReplicatedBackend::_do_push(OpRequestRef op) vector replies; ObjectStore::Transaction t; + ostringstream ss; + if (get_parent()->check_failsafe_full(ss)) { + dout(10) << __func__ << " Out of space (failsafe) processing push request: " << ss.str() << dendl; + ceph_abort(); + } for (vector::const_iterator i = m->pushes.begin(); i != m->pushes.end(); ++i) { @@ -862,6 +867,13 @@ void ReplicatedBackend::_do_pull_response(OpRequestRef op) op->mark_started(); vector replies(1); + + ostringstream ss; + if (get_parent()->check_failsafe_full(ss)) { + dout(10) << __func__ << " Out of space (failsafe) processing pull response (push): " << ss.str() << dendl; + ceph_abort(); + } + ObjectStore::Transaction t; list to_continue; for (vector::const_iterator i = m->pushes.begin();