diff options
Diffstat (limited to 'src/osd/OSD.cc')
-rw-r--r-- | src/osd/OSD.cc | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 1ee4c09a63e..8cc9e31459d 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -3267,21 +3267,30 @@ bool remove_dir( } t->remove(coll, *i); if (num >= g_conf->osd_target_transaction_size) { - store->apply_transaction(osr, *t); + C_SaferCond waiter; + store->queue_transaction(osr, t, &waiter); + bool cont = dstate->pause_clearing(); + waiter.wait(); + if (cont) + cont = dstate->resume_clearing(); delete t; - if (!dstate->check_canceled()) { - // canceled! + if (!cont) return false; - } t = new ObjectStore::Transaction; num = 0; } } olist.clear(); } - store->apply_transaction(osr, *t); + + C_SaferCond waiter; + store->queue_transaction(osr, t, &waiter); + bool cont = dstate->pause_clearing(); + waiter.wait(); + if (cont) + cont = dstate->resume_clearing(); delete t; - return true; + return cont; } void OSD::RemoveWQ::_process(pair<PGRef, DeletingStateRef> item) |