osd: use lower_bound to find head operation in pg_cancel_write_queue #90

Merged
vitalif merged 1 commits from changwei.ye/vitastor:fix-pg-cancle-write-queue into master 2026-10-17 21:20:36 +03:00

1 Commits

Author SHA1 Message Date
Changwei Ye
f0816f6ed0 osd: use lower_bound to find head operation in pg_cancel_write_queue
std::multimap::find() is not guaranteed by the C++ standard to return the
first element of a range with equivalent keys, which may fail to retrieve
the head operation in pg.write_queue.

Switch to lower_bound() to reliably locate the head of the queue in O(log N)
time, and add an explicit check for it->first == oid to prevent falsely
matching a subsequent larger key when the target oid is missing.
2026-10-15 12:12:55 +08:00