]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Check failsafe full and crash on push/pull
authorDavid Zafman <dzafman@redhat.com>
Mon, 3 Apr 2017 23:20:35 +0000 (16:20 -0700)
committerDavid Zafman <dzafman@redhat.com>
Mon, 17 Apr 2017 15:00:24 +0000 (08:00 -0700)
Signed-off-by: David Zafman <dzafman@redhat.com>
src/osd/ECBackend.cc
src/osd/PGBackend.h
src/osd/PrimaryLogPG.cc
src/osd/PrimaryLogPG.h
src/osd/ReplicatedBackend.cc

index 8e7b09fe38aec5a5256b15b213691ccdb1a31164..ea285cc4e6f44162e9f98225740bd626eac2f7d9 100644 (file)
@@ -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;
index 763e02bc2b8a968923190e039685e39f0f6b03cf..ddd0612b1313c0fd9b9073f8c8483930cc0c200a 100644 (file)
@@ -261,6 +261,8 @@ typedef ceph::shared_ptr<const OSDMap> OSDMapRef;
 
      virtual LogClientTemp clog_error() = 0;
 
+     virtual bool check_failsafe_full(ostream &ss) = 0;
+
      virtual ~Listener() {}
    };
    Listener *parent;
index 5a73ca5e98206e808c69034b5b922e9a5ef0d5b7..9398783d86701d67e5fca750e0fc7ebf6b5efebb 100644 (file)
@@ -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"); }
 
index 3d92e3b968cdb136ffd1d76bc36c7ad82584921b..f5b025db0e4fd68e86e10a2a2bccdf104c306efd 100644 (file)
@@ -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(
index b897eddf8157ec5e6a5232d183a3da315750ec64..1364cc6277025839643bfcbb1d75c6c66250471f 100644 (file)
@@ -807,6 +807,11 @@ void ReplicatedBackend::_do_push(OpRequestRef op)
 
   vector<PushReplyOp> 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<PushOp>::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<PullOp> 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<pull_complete_info> to_continue;
   for (vector<PushOp>::const_iterator i = m->pushes.begin();