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

关于SCDB API调用出现的问题 #440

Open
llsydn opened this issue Jan 16, 2025 · 10 comments
Open

关于SCDB API调用出现的问题 #440

llsydn opened this issue Jan 16, 2025 · 10 comments

Comments

@llsydn
Copy link

llsydn commented Jan 16, 2025

Issue Type

Others

Have you searched for existing issues?

Yes

Link to Relevant Documentation

No response

Question Details

基于中心化部署,相关环境已经部署好了。./scdbclient 环境下,已经将demo的案例跑好了,在./scdbclient下面执行命令,已经可以成功查询到结果。

但是在使用SCDB API调用查询相关sql后,就出现了下面的问题。
@llsydn
Copy link
Author

llsydn commented Jan 16, 2025

问题一:

./scdbclient 环境下,执行案例提供的sql语句是可以正常查询的
image

使用/public/submit_and_get接口,执行一样的sql后,就报下面的错了。
image

在通过接口调用后,再次使用./scdbclient 环境下,执行一样的sql语句,也是出现了上面的错。
只有重启了engine后,再通过./scdbclient 环境下,执行一样的sql语句,才会恢复正常。

问题二:

使用异步api的问题。先调用/public/submit_query,再调用/public/fetch_result,一直是拿不到结果。查询的sql也是比较简单。
image
image

但直接使用同步api,调用/public/submit_and_get,是可以拿到结果。
image

@lanyy9527
Copy link

用的是哪个版本的?

@llsydn
Copy link
Author

llsydn commented Jan 16, 2025

用的是哪个版本的?

用的是0.9.2b1,最新版本。
我发现好像不是调用api问题,执行案例提供的sql,在./scdbclient 环境下,执行多几次后,就会出现这个问题。

SELECT ta.credit_rank, COUNT(*) as cnt, AVG(ta.income) as avg_income, AVG(tb.order_amount) as avg_amount FROM ta INNER JOIN tb ON ta.ID = tb.ID WHERE ta.age >= 20 AND ta.age <= 30 AND tb.is_active=1 GROUP BY ta.credit_rank;
WARN[0060] content-type (text/plain; charset=utf-8) is not one of application/json and application/x-protobuf
[fetch]err: Code: 320, message:RunExecutionPlan create session(2e78f74b-d3d4-11ef-9517-0242ac180005) failed, catch std::exception=[engine/link/mux_link_factory.cc:188] send failed: link_id=2e78f74b-d3d4-11ef-9517-0242ac180005 sender_rank=0 send key=connect_00, peer failed code=1, message=dispatch error, link_id=2e78f74b-d3d4-11ef-9517-0242ac180005, error=Resource deadlock avoided.

@jingshi-ant
Copy link
Collaborator

您好,能提供下部署的环境信息吗?(os、cpu架构等,以及是否有特殊网关配置)

@llsydn
Copy link
Author

llsydn commented Jan 16, 2025

您好,能提供下部署的环境信息吗?(os、cpu架构等,以及是否有特殊网关配置)

CentOS Linux 7
image

应该是没有特殊网关配置的,因为我使用单机docker-compose部署,和案例提供的demo一样的,也是出现了这个问题。

@jingshi-ant
Copy link
Collaborator

能否补充下scqlengine的日志? docker logs xxx-engine-xxx

@llsydn
Copy link
Author

llsydn commented Jan 16, 2025

能否补充下scqlengine的日志? docker logs xxx-engine-xxx

执行sql
image

alice-engine
image

bob-engine
image

@jingshi-ant
Copy link
Collaborator

目前看bob-engine的日志有点奇怪,try stop send thread不应该出现。(除非timeout到了,作业被取消)
方便的话辛苦提供下更全的bob engine日志,以及scdb container的日志,以方便进一步确认问题。

@llsydn
Copy link
Author

llsydn commented Jan 16, 2025

目前看bob-engine的日志有点奇怪,try stop send thread不应该出现。(除非timeout到了,作业被取消) 方便的话辛苦提供下更全的bob engine日志,以及scdb container的日志,以方便进一步确认问题。

我这边好像发现了问题,因为我这边想修改engine之间的通信,改成http协议,所以我在gflags.conf文件加了下面的配置:

--driver_enable_ssl_as_client=false
--peer_engine_protocol=http:proto
--peer_engine_connection_type=pooled
--peer_engine_load_balancer=rr

然后把这些配置注释后,重启engine后,就正常了。

@llsydn
Copy link
Author

llsydn commented Jan 16, 2025

问题二:

使用异步api的问题。先调用/public/submit_query,再调用/public/fetch_result,一直是拿不到结果。查询的sql也是比较简单。
但直接使用同步api,调用/public/submit_and_get,是可以拿到结果。

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

No branches or pull requests

3 participants