From 36b02575ebf1cc6384322eafed8806bf6cf0a2ed Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sun, 29 Apr 2012 07:59:44 -0700 Subject: [PATCH] osd: fix nested transaction in all_activated_and_committed() all_activated_and_committed() is called from _activate_committed(), called from a objectstore completion, and also from the state machine, which is part of a larger transaction. Instead, set dirty_info, and build/apply a transaction in the caller (the completion) as needed. Fixes part of #2360. Signed-off-by: Sage Weil --- src/osd/PG.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index b447dd8067520..d09a4f7653328 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -1491,6 +1491,14 @@ void PG::_activate_committed(epoch_t e, entity_inst_t& primary) m->pg_list.push_back(make_pair(i, pg_interval_map_t())); osd->cluster_messenger->send_message(m, primary); } + + if (dirty_info) { + ObjectStore::Transaction *t = new ObjectStore::Transaction; + write_info(*t); + int tr = osd->store->queue_transaction(&osr, t); + assert(tr == 0); + } + unlock(); put(); } @@ -1509,10 +1517,7 @@ void PG::all_activated_and_committed() info.history.last_epoch_started = get_osdmap()->get_epoch(); share_pg_info(); - ObjectStore::Transaction *t = new ObjectStore::Transaction; - write_info(*t); - int tr = osd->store->queue_transaction(&osr, t); - assert(tr == 0); + dirty_info = true; } void PG::queue_snap_trim() -- 2.39.5