Bug #41216
os/bluestore: Don't forget sub kv_submitted_waiters.
0%
Description
in func flush_all_but_last, it forgets to dec kv_submitted_waiters when it returns for condition "it->state >= TransContext::STATE_KV_SUBMITTE".
void flush_all_but_last() {
std::unique_lock l(qlock);
assert (q.size() >= 1);
while (true) {
// set flag before the check because the condition
// may become true outside qlock, and we need to make
// sure those threads see waiters and signal qcond.
+kv_submitted_waiters;
if (q.size() <= 1) {
--kv_submitted_waiters;
return;
} else {
auto it = q.rbegin();
it+;
if (it->state >= TransContext::STATE_KV_SUBMITTED) {
return;
}
}
qcond.wait(l);
--kv_submitted_waiters;
}
}
Related issues
History
#1 Updated by jianpeng ma over 4 years ago
PR: https://github.com/ceph/ceph/pull/29522 fix this bug.
#2 Updated by Kefu Chai over 4 years ago
- Status changed from New to Pending Backport
- Backport set to nautilus
i think the minimal fix is https://github.com/ceph/ceph/pull/29522/commits/e782ac6fcf1ddea62f4aba7ff0d0f4c2e67d503c
#3 Updated by Nathan Cutler over 4 years ago
- Copied to Backport #41258: nautilus: os/bluestore: Don't forget sub kv_submitted_waiters. added
#4 Updated by Igor Fedotov over 4 years ago
- Pull request ID set to 29522
#5 Updated by Nathan Cutler over 4 years ago
- Status changed from Pending Backport to Resolved
While running with --resolve-parent, the script "backport-create-issue" noticed that all backports of this issue are in status "Resolved" or "Rejected".