From b1b299d337c40dc5b2f8d5b35338427dade0f043 Mon Sep 17 00:00:00 2001 From: Dong Yuan Date: Tue, 20 Jan 2015 09:23:53 +0000 Subject: [PATCH] osd: revert d427ca35404a30e1f428859c3274e030f2f83ef6 d427ca35404a30e1f428859c3274e030f2f83ef6 reversed the order of localt and op_t, while some logic depends on the order of localt and op_t. This commit revert d427ca35404a30e1f428859c3274e030f2f83ef6. Fix http://tracker.ceph.com/issues/10534. Change-Id: I5adba561d10274e3d12f89418a755c39e5e5f086 Signed-off-by: Dong Yuan --- src/osd/ReplicatedBackend.cc | 4 +++- src/osd/ReplicatedPG.cc | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/osd/ReplicatedBackend.cc b/src/osd/ReplicatedBackend.cc index 3a76a65e458..d15267291f8 100644 --- a/src/osd/ReplicatedBackend.cc +++ b/src/osd/ReplicatedBackend.cc @@ -586,7 +586,9 @@ void ReplicatedBackend::submit_transaction( trim_rollback_to, true, &local_t); - (*op_t).append(local_t); + + local_t.append(*op_t); + local_t.swap(*op_t); op_t->register_on_applied_sync(on_local_applied_sync); op_t->register_on_applied( diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 904119e2702..bf2ec506305 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -8443,14 +8443,14 @@ void ReplicatedBackend::sub_op_modify_impl(OpRequestRef op) op->mark_started(); - rm->opt.append(rm->localt); - rm->opt.register_on_commit( + rm->localt.append(rm->opt); + rm->localt.register_on_commit( parent->bless_context( new C_OSD_RepModifyCommit(this, rm))); - rm->opt.register_on_applied( + rm->localt.register_on_applied( parent->bless_context( new C_OSD_RepModifyApply(this, rm))); - parent->queue_transaction(&(rm->opt), op); + parent->queue_transaction(&(rm->localt), op); // op is cleaned up by oncommit/onapply when both are executed }