-
Notifications
You must be signed in to change notification settings - Fork 59
refactor: move rpc handler on_query_configuration_by_index from meta_service to server_state #597
base: master
Are you sure you want to change the base?
Conversation
src/meta/meta_service.h
Outdated
int check_leader(TRpcHolder rpc, /*out*/ rpc_address *forward_address); | ||
template <typename TRpcHolder> | ||
bool check_status(TRpcHolder rpc, /*out*/ rpc_address *forward_address = nullptr); | ||
int check_leader(TRpcHolder rpc, rpc_address *forward_address) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What did this modification fix? Why move the implementation to the header file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we don't move this to header file, the linker will produce error. It seems it can't do the template instantiation work if we don't move it to header file.
I moved the implementation of check_status and check_leader out of class meta_service, but they are still being put in the header file.
This reverts commit 1fce6b2.
#include <set> | ||
|
||
namespace dsn { | ||
|
||
DEFINE_TASK_CODE(LPC_RPC_TIMEOUT, TASK_PRIORITY_COMMON, THREAD_POOL_DEFAULT) | ||
|
||
DSN_DEFINE_bool("core", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does this config item used for? when to config true and when false?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this configuration is used for unit test to disable register rpc handlers. Because in some unit tests, one same rpc handler will register twice more times, and this will produce coredump. So you can set this configuration to false to avoid this situation.
In previous implementation, all rpc_handlers in meta server is registered in
meta_service
. And then the rpc request is forwarded toserver_state
、bulk_load_service
and so on, to handle this request.In this pull request, the rpc handler
on_query_configuration_by_index
is put toserver_state
, no need to forward bymeta_service