Skip to content
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

[enhancement](cloud) reconnect after the RPC request to the meta service fails #45668

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

luwei16
Copy link
Contributor

@luwei16 luwei16 commented Dec 19, 2024

No description provided.

@hello-stephen
Copy link
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@luwei16
Copy link
Contributor Author

luwei16 commented Dec 19, 2024

run buildall

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 38.87% (10132/26064)
Line Coverage: 29.79% (85203/285983)
Region Coverage: 28.90% (43455/150384)
Branch Coverage: 25.43% (22154/87134)
Coverage Report: http://coverage.selectdb-in.cc/coverage/efb1c77428e77bb213addbaba4bc017ce6b707bf_efb1c77428e77bb213addbaba4bc017ce6b707bf/report/index.html

}

private:
static Status get_pooled_client(std::shared_ptr<MetaService_Stub>* stub) {
static Status get_pooled_client(std::shared_ptr<MetaService_Stub>* stub,
MetaServiceProxy** proxy) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try not to use double stars. is it possible to use a pointer to an unique_ptr?

@@ -447,6 +481,7 @@ Status CloudMetaMgr::sync_tablet_rowsets(CloudTablet* tablet, bool warmup_delta_
.tag("partition_id", tablet->partition_id())
.tag("tried", tried)
.tag("sleep", duration_ms);
proxy->set_unhealthy();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not set_unhealthy() right after we get if (cntl.Failed())? it should not rely on retry_times

return Status::RpcError("failed to get delete bitmap: {}", cntl.ErrorText());

int retry_times = 0;
brpc::Controller cntl;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put it into the while loop

std::shared_ptr<MetaService_Stub> stub;
RETURN_IF_ERROR(MetaServiceProxy::get_client(&stub));
MetaServiceProxy* proxy;
RETURN_IF_ERROR(MetaServiceProxy::get_proxy(&proxy));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not use a new proxy every time we retry?

}

private:
static Status get_pooled_client(std::shared_ptr<MetaService_Stub>* stub) {
static Status get_pooled_client(std::shared_ptr<MetaService_Stub>* stub,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add comment for this methods including behavior and params

}

static Status get_proxy(MetaServiceProxy** proxy) {
std::shared_ptr<MetaService_Stub> stub;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add comment for this function, and the stub is a placeholder

@@ -3307,4 +3307,6 @@ public static int metaServiceRpcRetryTimes() {
"For disabling certain SQL queries, the configuration item is a list of simple class names of AST"
+ "(for example CreateRepositoryStmt, CreatePolicyCommand), separated by commas."})
public static String block_sql_ast_names = "";

public static long ms_rpc_reconn_interval_ms = 20000;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use full name meta_service_rpc_reconnect_interval_ms and add comment for it

@@ -111,5 +111,9 @@ DECLARE_mBool(enable_use_cloud_unique_id_from_fe);

DECLARE_Bool(enable_cloud_tablet_report);

DECLARE_mInt32(delete_bitmap_rpc_retry_times);

DECLARE_mInt64(ms_rpc_reconn_interval_ms);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use full name meta_service_rpc_reconnect_interval_ms and add comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants