storage_service: Do not take api lock for get_load_map

It is used by

nodetool status

If an api operation inside storage_service takes a long time to finish
, which holds the lock, it will block nodetool status for a long time.

I think it is safe to get the load map even if other operations are in-flight.

Refs: #850

Message-Id: <1456737987-32353-2-git-send-email-asias@scylladb.com>
This commit is contained in:
Asias He
2016-02-29 09:26:27 +00:00
committed by Avi Kivity
parent 84447fd7b0
commit e36a99ef23

View File

@@ -1952,7 +1952,7 @@ sstring storage_service::get_load_string() {
}
future<std::map<sstring, double>> storage_service::get_load_map() {
return run_with_read_api_lock([] (storage_service& ss) {
return run_with_no_api_lock([] (storage_service& ss) {
std::map<sstring, double> load_map;
auto& lb = ss.get_load_broadcaster();
if (lb) {