From 7923e374028324ecd6411d61004b87f3d874685c Mon Sep 17 00:00:00 2001 From: sageweil Date: Fri, 8 Jun 2007 23:50:31 +0000 Subject: [PATCH] * minor read balancing fixes git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1413 29311d96-e01e-0410-9327-a35deaab8ce9 --- branches/sage/pgs/TODO | 2 +- branches/sage/pgs/osd/ReplicatedPG.cc | 9 +++++++-- branches/sage/pgs/osd/ReplicatedPG.h | 1 - 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/branches/sage/pgs/TODO b/branches/sage/pgs/TODO index e288f15e09c6c..d636339800220 100644 --- a/branches/sage/pgs/TODO +++ b/branches/sage/pgs/TODO @@ -229,7 +229,7 @@ osd/rados - mark residual pgs obsolete ??? - rdlocks - optimize remove wrt recovery pushes -- pg_bit/pg_num changes +- pg_num changes - report crashed pgs? simplemessenger diff --git a/branches/sage/pgs/osd/ReplicatedPG.cc b/branches/sage/pgs/osd/ReplicatedPG.cc index 06b533928cdfe..27482ac595d65 100644 --- a/branches/sage/pgs/osd/ReplicatedPG.cc +++ b/branches/sage/pgs/osd/ReplicatedPG.cc @@ -317,6 +317,8 @@ void ReplicatedPG::do_op(MOSDOp *op) case OSD_OP_RDUNLOCK: case OSD_OP_UPLOCK: case OSD_OP_DNLOCK: + case OSD_OP_BALANCEREADS: + case OSD_OP_UNBALANCEREADS: if (op->get_source().is_osd()) { op_rep_modify(op); } else { @@ -706,10 +708,12 @@ void ReplicatedPG::apply_repop(RepGather *repop) case OSD_OP_BALANCEREADS: dout(-10) << "apply_repop completed balance-reads on " << oid << dendl; + /* if (waiting_for_balanced_reads.count(oid)) { osd->take_waiters(waiting_for_balanced_reads[oid]); waiting_for_balanced_reads.erase(oid); } + */ break; case OSD_OP_WRUNLOCK: @@ -1052,8 +1056,9 @@ void ReplicatedPG::op_modify(MOSDOp *op) // balance-reads set? char v; - if (osd->store->getattr(op->get_oid(), "balance-reads", &v, 1) >= 0 || - balancing_reads.count(op->get_oid())) { + if ((op->get_op() != OSD_OP_BALANCEREADS && op->get_op() != OSD_OP_UNBALANCEREADS) && + (osd->store->getattr(op->get_oid(), "balance-reads", &v, 1) >= 0 || + balancing_reads.count(op->get_oid()))) { if (!unbalancing_reads.count(op->get_oid())) { // unbalance diff --git a/branches/sage/pgs/osd/ReplicatedPG.h b/branches/sage/pgs/osd/ReplicatedPG.h index 703fb2d7f2bae..3ee6e48039ff8 100644 --- a/branches/sage/pgs/osd/ReplicatedPG.h +++ b/branches/sage/pgs/osd/ReplicatedPG.h @@ -75,7 +75,6 @@ protected: // load balancing set balancing_reads; set unbalancing_reads; - hash_map > waiting_for_balanced_reads; hash_map > waiting_for_unbalanced_reads; // i.e. primary-lock void get_rep_gather(RepGather*); -- 2.39.5