filestore: fix wake condition when journal submission blocks

We only want to wake up if we are at the front of the line, in order to
preserve journal submission pipeline ordering.

This fixes, among other things, messages in the log like

2010-12-21 10:38:42.515974 7f0861486700 journal op_submit_finish 5364 expected 5370, OUT OF ORDER

and bug #666.

Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
Sage Weil 2011-01-03 13:14:13 -08:00
parent 15dcc65199
commit 259c509a89

View File

@ -106,7 +106,7 @@ uint64_t JournalingObjectStore::_op_apply_start(uint64_t op)
Cond cond;
ops_apply_blocked.push_back(&cond);
dout(10) << "op_apply_start " << op << " blocked (getting in back of line)" << dendl;
while (blocked)
while (blocked && ops_apply_blocked.front() != &cond)
cond.Wait(journal_lock);
dout(10) << "op_apply_start " << op << " woke (at front of line)" << dendl;
ops_apply_blocked.pop_front();