-
Notifications
You must be signed in to change notification settings - Fork 312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(hotspot): replace partition_resolver to ddl_client #641
Conversation
@@ -316,7 +316,8 @@ info_collector::get_hotspot_calculator(const std::string &app_name, const int pa | |||
if (iter != _hotspot_calculator_store.end()) { | |||
return iter->second; | |||
} | |||
auto calculator = std::make_shared<hotspot_partition_calculator>(app_name, partition_count); | |||
auto calculator = | |||
std::make_shared<hotspot_partition_calculator>(app_name, partition_count, _shell_context); |
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.
I think ddl_client is necessary for hotspot_partition_calculator
, you can create a new ddl client instance for calculator, not share the shell_context with info_collector.
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.
There will be a lot of hotspot_partition_calculator
(s) in one database, I think it is better to share one instance
int partition_count; | ||
std::vector<dsn::partition_configuration> partitions; | ||
_shell_context->ddl_client->list_app(app_name, app_id, partition_count, partitions); | ||
auto target_address = partitions[partition_index].primary; |
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.
It seems that you don't validate the partition_index
, will the caller ensure that the partition_index
is valid?
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.
Yes, it will ensure
Co-authored-by: Yingchun Lai <[email protected]>
After
detect_hotkey_request
was removed from rrdb_types,partition_resolver
needs to be replaced to send RPC correctly.