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

Support fe heartbeat use thrift protocol to get stable response #5027

Merged
merged 5 commits into from
Dec 16, 2020

Conversation

caiconghui
Copy link
Contributor

Proposed changes

This PR is to support fe master get fe heartbeat response by thrift protocol instead of http protocol.

Types of changes

What types of changes does your code introduce to Doris?
Put an x in the boxes that apply

  • [] Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • [] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [] Documentation Update (if none of the other choices apply)
  • [] Code refactor (Modify the code structure, format the code, etc...)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

Further comments

If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...

}

struct TFrontendPingFrontendRequest {
1: required i32 clusterId
Copy link
Contributor

Choose a reason for hiding this comment

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

required field should be used very carefully, reference here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think if the filed is really required and the TFrontendPingFrontendRequest is firstly constructed to use, the field used requried is ok

@@ -689,4 +708,6 @@ service FrontendService {
TStreamLoadPutResult streamLoadPut(1: TStreamLoadPutRequest request)

Status.TStatus snapshotLoaderReport(1: TSnapshotLoaderReportRequest request)
}

TBootstrapResult ping(1: TFrontendPingFrontendRequest request)
Copy link
Contributor

Choose a reason for hiding this comment

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

The request and response names are unmatched with the service name.

Copy link
Contributor Author

@caiconghui caiconghui Dec 7, 2020

Choose a reason for hiding this comment

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

thank you for your advice, I will change it.

Copy link
Contributor

@sduzh sduzh Dec 8, 2020

Choose a reason for hiding this comment

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

If service is named as ping, why not just name the request/response as TPingRequest/TPingResponse. I'm just curious about the naming rule of Doris, it's kind of weird for me.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry to intervene, It's just my personal options, you can just ignore them all ^_^

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In my option, by TFrontendPingFrontendRequest, we can know the request is sent by fe to fe, by TPingRequest is less information?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I get what you mean, actually, TFrontendPingFrontendRequest is like the name in

 TBrokerOperationStatus ping(1: TBrokerPingBrokerRequest request);

}

struct TBootstrapResult {
1: required TFrontendPingFrontendStatusCode status
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it ok to use TStatus here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

TStatus is used for be, just like TBrokerOperationStatus is used for broker, so I think use new status for fe would be better

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I am also not sure to reuse the TStatus or just like


enum TBrokerOperationStatusCode {
    OK = 0;
    END_OF_FILE = 301;
    
    // user input error
    NOT_AUTHORIZED = 401;
    DUPLICATE_REQUEST = 402;
    INVALID_INPUT_OFFSET = 403; // user input offset is invalid, is large than file length
    INVALID_INPUT_FILE_PATH = 404;
    INVALID_ARGUMENT = 405;
    
    // internal server error
    FILE_NOT_FOUND = 501;
    TARGET_STORAGE_SERVICE_ERROR = 502; // the target storage service error
    OPERATION_NOT_SUPPORTED = 503; // the api is not implemented
}

define new status struct

if (Config.enable_fe_heartbeat_by_thrift) {
return getHeartbeatResponseByThrift();
} else {
return getHeartbeatResponseByHttp();
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it really necessary to keep the HTTP based codes?
cc @kangkaisen

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sduzh be compatible with older versions(0.13), and should be moved next version(0.15). if you ugrade non master fe first, the heartbeat will fail.

Copy link
Contributor

@kangkaisen kangkaisen left a comment

Choose a reason for hiding this comment

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

+1

@kangkaisen kangkaisen added the approved Indicates a PR has been approved by one committer. label Dec 15, 2020
Copy link
Contributor

@morningman morningman left a comment

Choose a reason for hiding this comment

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

LGTM

@morningman morningman merged commit dfa4133 into apache:master Dec 16, 2020
morningman pushed a commit to baidu-doris/incubator-doris that referenced this pull request Jan 5, 2021
…esponse (apache#5027)

This PR is to support fe master get fe heartbeat response by thrift protocol instead of http protocol.
@yangzhg yangzhg mentioned this pull request Feb 9, 2021
@caiconghui caiconghui deleted the heartbeat branch August 23, 2023 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by one committer.
Projects
None yet
4 participants