Skip to content
This repository has been archived by the owner on May 10, 2022. It is now read-only.

re-implement getting forward address from configuration_query_by_inde… #28

Merged
merged 3 commits into from
Jan 14, 2019

Conversation

qinzuoyan
Copy link
Member

…x_response

we re-implement it in other way to fix compatibility problem of #27

for the reason, please refer to XiaoMi/rdsn#217

@qinzuoyan qinzuoyan added the bug Something isn't working label Jan 13, 2019
@qinzuoyan qinzuoyan self-assigned this Jan 13, 2019
needDelay = true;
needSwitchLeader = false;
needDelay = false;
needSwitchLeader = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

现在onFinishQueryMeta的逻辑变成了只要query meta失败就立即switch meta,ERR_SERVICE_NOT_ACTIVE和ERR_FORWARD_TO_OTHERS这两个错误码,就没有区别了,我理解ERR_SERVICE_NOT_ACTIVE是指当前meta是leader,但是只是暂时不可用,可以不用switch的

Copy link
Member Author

Choose a reason for hiding this comment

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

这里考虑了一下,确实还是应当维持原来的逻辑:ERR_SERVICE_NOT_ACTIVE是指当前meta是leader,但是只是暂时不可用,可以不用switch,但是要delay。

@@ -136,7 +141,7 @@ else if (metaError == error_types.ERR_FORWARD_TO_OTHERS) {
}
}
else if (op.rpc_error.errno == error_types.ERR_SESSION_RESET || op.rpc_error.errno == error_types.ERR_TIMEOUT) {
needDelay = true;
needDelay = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

遇到timeout和reset也不delay了,也是立即switch吗?

Copy link
Member Author

Choose a reason for hiding this comment

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

是的。reset一般是connection refused,说明meta-server进程未启动,应当立即switch;timeout的时候可能是网络出了问题,处于保险还是switch比较好。

@qinzuoyan qinzuoyan merged commit 920217a into thrift-0.11.0-inlined Jan 14, 2019
@qinzuoyan qinzuoyan deleted the fix_forward branch January 14, 2019 09:17
neverchanje pushed a commit that referenced this pull request Jun 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants