summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Farnum <greg@inktank.com>2013-10-22 14:53:33 -0700
committerGreg Farnum <greg@inktank.com>2013-10-22 14:53:33 -0700
commitf915eec60b32262f2028b83441302dfca1814dd3 (patch)
tree4571619788cd6f54a99f16c3f5357e39d5fe50af
parent12de51f9356e6b605265f47cf4486c0b9d5c41bc (diff)
downloadceph-f915eec60b32262f2028b83441302dfca1814dd3.tar.gz
ReplicatedPG: take recovery locks in recover_primary()
This was causing tons of crashes Signed-off-by: Greg Farnum <greg@inktank.com>
-rw-r--r--src/osd/ReplicatedPG.cc9
-rw-r--r--src/osd/ReplicatedPG.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc
index fd0d20b36e5..01dfaea5bbf 100644
--- a/src/osd/ReplicatedPG.cc
+++ b/src/osd/ReplicatedPG.cc
@@ -6685,6 +6685,8 @@ bool ReplicatedBackend::handle_push_reply(int peer, PushReplyOp &op, PushOp *rep
<< pi->recovery_progress.data_recovered_to
<< " of " << pi->recovery_info.copy_subset << dendl;
ObjectRecoveryProgress new_progress;
+ // we don't need to take the recovery locks here because we already have
+ // them from before
int r = build_push_op(
pi->recovery_info,
pi->recovery_progress, &new_progress, reply,
@@ -7648,6 +7650,13 @@ int ReplicatedPG::recover_primary(int max, ThreadPool::TPHandle &handle)
latest = 0;
soid = p->second;
}
+
+ if (!rw_manager.get_backfill_read(soid)) {
+ if (!started)
+ ++started; // just lie; this won't impact anything except debug output
+ break;
+ }
+
const pg_missing_t::item& item = missing.missing.find(p->second)->second;
++p;
diff --git a/src/osd/ReplicatedPG.h b/src/osd/ReplicatedPG.h
index 7290b35e4e6..b8aca328304 100644
--- a/src/osd/ReplicatedPG.h
+++ b/src/osd/ReplicatedPG.h
@@ -865,6 +865,7 @@ protected:
// Cancels/resets pulls from peer
void check_recovery_sources(const OSDMapRef map);
+ // Make sure you have the recovery locks on the object before calling in here
int recover_missing(
const hobject_t& oid,
eversion_t v,