All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Poelzleithner <poelzleithner@b1-systems.de>
To: ceph-devel@vger.kernel.org
Subject: [PATCH] Fix for corrupted ceph cluster
Date: Tue, 11 Feb 2014 07:48:01 +0100	[thread overview]
Message-ID: <52F9C7A1.3060705@b1-systems.de> (raw)

Hi,

I wrote a small patch that ignores object_trim requests when he does not
find the context of this request.
We have a node that fails to start permanently and there is no way to
get all nodes back up.

As far as I understood, deleting something that does not exist should
not cause an assert. It is wired, but should not cause abort.

This is regarding bug http://tracker.ceph.com/issues/6101

Any help is highly appreciated.

kind regards
 Daniel


---
 src/osd/ReplicatedPG.cc | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc
index 90d3e1d..d7e0b62 100644
--- a/src/osd/ReplicatedPG.cc
+++ b/src/osd/ReplicatedPG.cc
@@ -1491,7 +1491,7 @@ ReplicatedPG::RepGather
*ReplicatedPG::trim_object(const hobject_t &coid)
   int r = find_object_context(coid, &obc, false, NULL);
   if (r == -ENOENT || coid.snap != obc->obs.oi.soid.snap) {
     derr << __func__ << "could not find coid " << coid << dendl;
-    assert(0);
+    return NULL;
   }
   assert(r == 0);
   assert(obc->registered);
@@ -7866,7 +7866,10 @@ boost::statechart::result
ReplicatedPG::TrimmingObjects::react(const SnapTrim&)

   dout(10) << "TrimmingObjects react trimming " << pos << dendl;
   RepGather *repop = pg->trim_object(pos);
-  assert(repop);
+  if (!repop) {
+      derr << "TrimmingObjects failed " << pos << dendl;
+      return discard_event();
+  }

   repop->queue_snap_trimmer = true;
   eversion_t old_last_update = pg->pg_log.get_head();
-- 
1.8.5.3

             reply	other threads:[~2014-02-11  6:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-11  6:48 Daniel Poelzleithner [this message]
2014-03-05 23:03 ` [PATCH] Fix for corrupted ceph cluster Daniel Poelzleithner
2014-03-05 23:12   ` Sage Weil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52F9C7A1.3060705@b1-systems.de \
    --to=poelzleithner@b1-systems.de \
    --cc=ceph-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.