From 59d6e18017bc9d4354d37f080fc63b62a86996a7 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 26 Jan 2009 13:50:53 -0800 Subject: [PATCH] osd: keep peer_info.last_{update,complete} up to date in case we get later stray We need to be able to call peer() again after going active and get meaningful results. --- src/osd/ReplicatedPG.cc | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index e6abcdef95847..c900cf10c681c 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -1615,12 +1615,12 @@ void ReplicatedPG::op_modify(MOSDOp *op) // version - eversion_t av = log.top; + eversion_t at_version = log.top; if (!noop) { - av.epoch = osd->osdmap->get_epoch(); - av.version++; - assert(av > info.last_update); - assert(av > log.top); + at_version.epoch = osd->osdmap->get_epoch(); + at_version.version++; + assert(at_version > info.last_update); + assert(at_version > log.top); } // snap @@ -1632,11 +1632,11 @@ void ReplicatedPG::op_modify(MOSDOp *op) ProjectedObjectInfo *pinfo = get_projected_object(poid); // set version in op, for benefit of client and our eventual reply - op->set_version(av); + op->set_version(at_version); dout(10) << "op_modify " << opname << " " << poid.oid - << " ov " << pinfo->version << " av " << av + << " ov " << pinfo->version << " av " << at_version << " snapc " << snapc << " snapset " << pinfo->snapset << dendl; @@ -1671,10 +1671,12 @@ void ReplicatedPG::op_modify(MOSDOp *op) // issue replica writes tid_t rep_tid = osd->get_tid(); - RepGather *repop = new_repop(op, noop, rep_tid, pinfo, av, snapc); + RepGather *repop = new_repop(op, noop, rep_tid, pinfo, at_version, snapc); for (unsigned i=1; i info.stats.num_objects) @@ -1684,11 +1686,19 @@ void ReplicatedPG::op_modify(MOSDOp *op) if (!noop) { // log and update later. prepare_transaction(repop->t, op->get_reqid(), poid, op->ops, op->get_data(), - pinfo->exists, pinfo->size, pinfo->version, av, + pinfo->exists, pinfo->size, pinfo->version, at_version, pinfo->snapset, snapc, op->get_inc_lock(), trim_to); } + // keep peer_info up to date + for (unsigned i=1; iwaitfor_ack.count(whoami)); -- 2.39.5