-
Notifications
You must be signed in to change notification settings - Fork 25
re-implement getting forward address from configuration_query_by_inde… #28
Conversation
needDelay = true; | ||
needSwitchLeader = false; | ||
needDelay = false; | ||
needSwitchLeader = true; |
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.
现在onFinishQueryMeta的逻辑变成了只要query meta失败就立即switch meta,ERR_SERVICE_NOT_ACTIVE和ERR_FORWARD_TO_OTHERS这两个错误码,就没有区别了,我理解ERR_SERVICE_NOT_ACTIVE是指当前meta是leader,但是只是暂时不可用,可以不用switch的
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.
这里考虑了一下,确实还是应当维持原来的逻辑: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; |
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.
遇到timeout和reset也不delay了,也是立即switch吗?
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.
是的。reset一般是connection refused,说明meta-server进程未启动,应当立即switch;timeout的时候可能是网络出了问题,处于保险还是switch比较好。
…x_response
we re-implement it in other way to fix compatibility problem of #27
for the reason, please refer to XiaoMi/rdsn#217