diff options
author | Sage Weil <sage.weil@dreamhost.com> | 2012-04-29 07:59:44 -0700 |
---|---|---|
committer | Sage Weil <sage.weil@dreamhost.com> | 2012-04-29 08:11:25 -0700 |
commit | 36b02575ebf1cc6384322eafed8806bf6cf0a2ed (patch) | |
tree | b2d2b7d5b013e339d378cf308458da930ca02911 | |
parent | 3e84ce862ef2cdbe7ffc36e3f79cc07fb442f34a (diff) | |
download | ceph-36b02575ebf1cc6384322eafed8806bf6cf0a2ed.tar.gz |
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 <sage.weil@dreamhost.com>
-rw-r--r-- | src/osd/PG.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/osd/PG.cc b/src/osd/PG.cc index b447dd80675..d09a4f76533 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() |