-
Notifications
You must be signed in to change notification settings - Fork 3.7k
【Improvement】Avoid null host when forward to master #4844
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
Conversation
| private void forward() throws Exception { | ||
| String masterHost = ctx.getCatalog().getMasterIp(); | ||
| int masterRpcPort = ctx.getCatalog().getMasterRpcPort(); | ||
| if (masterHost == "" || masterRpcPort == 0) { |
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.
Maybe this is better. Put it at the beginning.
if (!ctx.getCatalog().isReady()) {
thrown new Exception("Node catalog is not ready, please wait for a while");
}
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.
Maybe this is better. Put it at the beginning.
if (!ctx.getCatalog().isReady()) { thrown new Exception("Node catalog is not ready, please wait for a while"); }
agree
morningman
left a comment
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.
LGTM
…onNormal remove the streaming_label_keep_max_second set apache#56428 (apache#4844) cherry-picks from apache#56428 Related to apache#4843 Co-authored-by: Refrain <113875799+0AyanamiRei@users.noreply.github.com>
Proposed changes
When a FE node forwards request to master FE node, if this node is not ready, it will get a
null hostand0port. It is not necessary to continue to create a rpc client.null hostwill cause a problem:Cannot open null host., like:`
2020-11-04 23:37:16,926 WARN 12098 [StmtExecutor.execute():306] execute Exception
java.lang.Exception: Failed to get master client.
at org.apache.doris.qe.MasterOpExecutor.forward(MasterOpExecutor.java:72) ~[palo-fe.jar:?]
at org.apache.doris.qe.MasterOpExecutor.execute(MasterOpExecutor.java:56) ~[palo-fe.jar:?]
at org.apache.doris.qe.StmtExecutor.forwardToMaster(StmtExecutor.java:335) ~[palo-fe.jar:?]
at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:231) [palo-fe.jar:?]
at org.apache.doris.qe.ConnectProcessor.handleQuery(ConnectProcessor.java:182) [palo-fe.jar:?]
at org.apache.doris.qe.ConnectProcessor.dispatch(ConnectProcessor.java:314) [palo-fe.jar:?]
at org.apache.doris.qe.ConnectProcessor.processOnce(ConnectProcessor.java:476) [palo-fe.jar:?]
at org.apache.doris.qe.ConnectProcessor.loop(ConnectProcessor.java:486) [palo-fe.jar:?]
at org.apache.doris.qe.ConnectScheduler$LoopHandler.run(ConnectScheduler.java:178) [palo-fe.jar:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:834) [?:?]
Caused by: org.apache.thrift.transport.TTransportException: Cannot open null host.
at org.apache.thrift.transport.TSocket.open(TSocket.java:210) ~[libthrift-0.9.3.jar:0.9.3]
at org.apache.doris.common.GenericPool$ThriftClientFactory.create(GenericPool.java:128) ~[palo-fe.jar:?]
at org.apache.doris.common.GenericPool$ThriftClientFactory.create(GenericPool.java:113) ~[palo-fe.jar:?]
at org.apache.commons.pool2.BaseKeyedPooledObjectFactory.makeObject(BaseKeyedPooledObjectFactory.java:62) ~[commons-pool2-2.2.jar:2.2]
at org.apache.commons.pool2.impl.GenericKeyedObjectPool.create(GenericKeyedObjectPool.java:1012) ~[commons-pool2-2.2.jar:2.2]
at org.apache.commons.pool2.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:356) ~[commons-pool2-2.2.jar:2.2]
at org.apache.commons.pool2.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:277) ~[commons-pool2-2.2.jar:2.2]
at org.apache.doris.common.GenericPool.borrowObject(GenericPool.java:89) ~[palo-fe.jar:?]
at org.apache.doris.qe.MasterOpExecutor.forward(MasterOpExecutor.java:69) ~[palo-fe.jar:?]
... 13 more
`
Types of changes
What types of changes does your code introduce to Doris?
Put an
xin the boxes that applyChecklist
Put an
xin 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...