From b84943cb459ae10f1b76f2024d4766165c3b084c Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Mon, 23 Mar 2015 11:50:10 -0700 Subject: [PATCH] Revert "osd/: don't block writes on degraded objects" This reverts commit f9abffbb2461b5988c0435ee2f7771eca028f29f. --- src/osd/ECBackend.cc | 1 + src/osd/ReplicatedPG.cc | 9 +++++++++ src/osd/ReplicatedPG.h | 8 +++----- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/osd/ECBackend.cc b/src/osd/ECBackend.cc index 951b249aaeb56..6e1362ec44c48 100644 --- a/src/osd/ECBackend.cc +++ b/src/osd/ECBackend.cc @@ -805,6 +805,7 @@ void ECBackend::handle_sub_write( { if (msg) msg->mark_started(); + assert(!get_parent()->get_log().get_missing().is_missing(op.soid)); if (!get_parent()->pgb_is_primary()) get_parent()->update_stats(op.stats); ObjectStore::Transaction *localt = new ObjectStore::Transaction; diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index a3cf228f8ed3f..ebe118be27e32 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -1440,6 +1440,12 @@ void ReplicatedPG::do_op(OpRequestRef& op) return; } + // degraded object? + if (write_ordered && is_degraded_object(head)) { + wait_for_degraded_object(head, op); + return; + } + // missing snapdir? hobject_t snapdir(m->get_oid(), m->get_object_locator().key, CEPH_SNAPDIR, m->get_pg().ps(), info.pgid.pool(), @@ -8487,6 +8493,9 @@ void ReplicatedBackend::sub_op_modify_impl(OpRequestRef op) // sanity checks assert(m->map_epoch >= get_info().history.same_interval_since); + // we better not be missing this. + assert(!parent->get_log().get_missing().is_missing(soid)); + int ackerosd = m->get_source().num(); op->mark_started(); diff --git a/src/osd/ReplicatedPG.h b/src/osd/ReplicatedPG.h index 8f7dfe5ea73ba..9785c276f1954 100644 --- a/src/osd/ReplicatedPG.h +++ b/src/osd/ReplicatedPG.h @@ -415,13 +415,11 @@ public: if (peer == get_primary()) return true; assert(peer_info.count(peer)); - bool should_send_backfill = hoid.pool != (int64_t)info.pgid.pool() || + bool should_send = hoid.pool != (int64_t)info.pgid.pool() || hoid <= MAX(last_backfill_started, peer_info[peer].last_backfill); - if (!should_send_backfill) + if (!should_send) assert(is_backfill_targets(peer)); - - assert(peer_missing.count(peer)); - return should_send_backfill && !peer_missing[peer].is_missing(hoid); + return should_send; } void update_peer_last_complete_ondisk( -- 2.39.5