mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-12 19:02:12 +00:00
reader_concurrency_semaphore: in stats, fix swapped count_resources and memory_resources
can_admit_read() returns reason::memory_resources when the permit is queued due
to lack of count resources, and it returns reason::count_resources when the
permit is queued due to lack of memory resources. It's supposed to be the other
way around.
This bug is causing the two counts to be swapped in the stat dumps printed to
the logs when semaphores time out.
(cherry picked from commit 6cf3747c5f)
Closes scylladb/scylladb#21030
This commit is contained in:
committed by
Avi Kivity
parent
363cf881d4
commit
b8a9fd4e49
@@ -1367,7 +1367,7 @@ reader_concurrency_semaphore::can_admit_read(const reader_permit::impl& permit)
|
||||
}
|
||||
|
||||
if (!has_available_units(permit.base_resources())) {
|
||||
auto reason = _resources.memory >= permit.base_resources().memory ? reason::memory_resources : reason::count_resources;
|
||||
auto reason = _resources.memory >= permit.base_resources().memory ? reason::count_resources : reason::memory_resources;
|
||||
if (_inactive_reads.empty()) {
|
||||
return {can_admit::no, reason};
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user