dout(10) << "start_sync" << dendl;
}
-void FileStore::trigger_commit(uint64_t seq)
-{
- /*
- * crib the lock -> journal_lock. we need to start the sync under lock,
- * but once we release lock it will block because journal_lock is held.
- * _trigger_commit() expects journal_lock to be held by the caller.
- */
- lock.Lock();
- dout(10) << "trigger_commit seq" << dendl;
- force_sync = true;
- sync_cond.Signal();
- journal_lock.Lock();
- lock.Unlock();
- _trigger_commit(seq);
- journal_lock.Unlock();
-}
-
void FileStore::sync()
{
Mutex l("FileStore::sync");
// ------------------------------------------
-/*
- * this may (will generally) get called by an op_queue thread holding
- * an open_ops reference. it should block only long enough for the
- * commit to _start_ waiting for open_ops, but not longer or else we
- * will deadlock.
- *
- * caller must hold journal_lock.
- */
-void JournalingObjectStore::_trigger_commit(uint64_t seq)
-{
- assert(journal_lock.is_locked());
- dout(10) << "trigger_commit " << seq << dendl;
- force_commit = true;
- while (!blocked && committing_seq < seq) {
- dout(20) << "trigger_commit not blocked and seq " << seq << " > committing " << committing_seq << dendl;
- cond.Wait(journal_lock);
- }
- dout(10) << "trigger_commit triggered, will commit something >= " << seq << dendl;
-}
-
bool JournalingObjectStore::commit_start()
{
bool ret = false;
<< ", applied_seq " << applied_seq
<< ", committed_seq " << committed_seq << dendl;
blocked = true;
- cond.Signal(); // for trigger_commit() caller
while (open_ops > 0) {
dout(10) << "commit_start blocked, waiting for " << open_ops << " open ops" << dendl;
cond.Wait(journal_lock);