api: Register snitch API earlier
Currently, we register snitch API in set_server_gossip_settle() which waits until a node has joined the cluster. This makes 'nodetool status' not properly show the status of a joining node. Fix the issue by registering snitch API earlier. Fixes #1269. Message-Id: <1463576381-15484-1-git-send-email-penberg@scylladb.com>
This commit is contained in:
@@ -83,6 +83,10 @@ future<> set_server_storage_service(http_context& ctx) {
|
||||
return register_api(ctx, "storage_service", "The storage service API", set_storage_service);
|
||||
}
|
||||
|
||||
future<> set_server_snitch(http_context& ctx) {
|
||||
return register_api(ctx, "endpoint_snitch_info", "The endpoint snitch info API", set_endpoint_snitch);
|
||||
}
|
||||
|
||||
future<> set_server_gossip(http_context& ctx) {
|
||||
return register_api(ctx, "gossiper",
|
||||
"The gossiper API", set_gossiper);
|
||||
@@ -118,10 +122,6 @@ future<> set_server_gossip_settle(http_context& ctx) {
|
||||
rb->register_function(r, "cache_service",
|
||||
"The cache service API");
|
||||
set_cache_service(ctx,r);
|
||||
|
||||
rb->register_function(r, "endpoint_snitch_info",
|
||||
"The endpoint snitch info API");
|
||||
set_endpoint_snitch(ctx, r);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ struct http_context {
|
||||
};
|
||||
|
||||
future<> set_server_init(http_context& ctx);
|
||||
future<> set_server_snitch(http_context& ctx);
|
||||
future<> set_server_storage_service(http_context& ctx);
|
||||
future<> set_server_gossip(http_context& ctx);
|
||||
future<> set_server_load_sstable(http_context& ctx);
|
||||
|
||||
1
main.cc
1
main.cc
@@ -538,6 +538,7 @@ int main(int ac, char** av) {
|
||||
}
|
||||
api::set_server_storage_service(ctx).get();
|
||||
api::set_server_gossip(ctx).get();
|
||||
api::set_server_snitch(ctx).get();
|
||||
api::set_server_messaging_service(ctx).get();
|
||||
api::set_server_storage_proxy(ctx).get();
|
||||
api::set_server_load_sstable(ctx).get();
|
||||
|
||||
Reference in New Issue
Block a user