[feature](cooldown) Decouple storage policy and resource (#15873)
This commit is contained in:
@ -131,46 +131,6 @@ Status MasterServerClient::report(const TReportRequest& request, TMasterResult*
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
Status MasterServerClient::refresh_storage_policy(TGetStoragePolicyResult* result) {
|
||||
Status client_status;
|
||||
FrontendServiceConnection client(_client_cache, _master_info.network_address,
|
||||
config::thrift_rpc_timeout_ms, &client_status);
|
||||
|
||||
if (!client_status.ok()) {
|
||||
LOG(WARNING) << "fail to get master client from cache. "
|
||||
<< "host=" << _master_info.network_address.hostname
|
||||
<< ", port=" << _master_info.network_address.port
|
||||
<< ", code=" << client_status.code();
|
||||
return Status::InternalError("Fail to get master client from cache");
|
||||
}
|
||||
|
||||
try {
|
||||
try {
|
||||
client->refreshStoragePolicy(*result);
|
||||
} catch (TTransportException& e) {
|
||||
// LOG(WARNING) << "master client, retry refresh_storage_policy: " << e.what();
|
||||
client_status = client.reopen(config::thrift_rpc_timeout_ms);
|
||||
if (!client_status.ok()) {
|
||||
LOG(WARNING) << "fail to get master client from cache. "
|
||||
<< "host=" << _master_info.network_address.hostname
|
||||
<< ", port=" << _master_info.network_address.port
|
||||
<< ", code=" << client_status.code();
|
||||
return Status::InternalError("Master client refresh storage policy failed");
|
||||
}
|
||||
client->refreshStoragePolicy(*result);
|
||||
}
|
||||
} catch (TException& e) {
|
||||
client.reopen(config::thrift_rpc_timeout_ms);
|
||||
LOG(WARNING) << "fail to refresh storge policy. "
|
||||
<< "host=" << _master_info.network_address.hostname
|
||||
<< ", port=" << _master_info.network_address.port
|
||||
<< ", code=" << client_status.code() << ", reason=" << e.what();
|
||||
return Status::InternalError("Fail to refresh storage policy from master");
|
||||
}
|
||||
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
bool AgentUtils::exec_cmd(const string& command, string* errmsg, bool redirect_stderr) {
|
||||
// The exit status of the command.
|
||||
uint32_t rc = 0;
|
||||
|
||||
Reference in New Issue
Block a user