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

Server never responds when the queries are sent from client libraries #3138

Closed
suzaku opened this issue Nov 28, 2021 · 9 comments
Closed

Server never responds when the queries are sent from client libraries #3138

suzaku opened this issue Nov 28, 2021 · 9 comments
Labels
C-bug Category: something isn't working

Comments

@suzaku
Copy link

suzaku commented Nov 28, 2021

Summary

Description for this bug.

How to reproduce

Use client libraries of Go/Python to connect Databend as clickhouse or mysql.

We can use pymysql as an example here, but I have observed similar situation when using the Go standard library.

import pymysql
conn = pymysql.Connection(host='localhost', user='root', port=3307)
c = conn.cursor()
c.execute("SELECT avg(number) FROM numbers(1000000);")

Error message and/or stacktrace

[2021-11-28T06:45:49Z INFO  databend_query::servers::mysql::mysql_handler] MySQL connection coming: Ok(172.17.0.1:64158)
[2021-11-28T06:46:04Z DEBUG databend_query::servers::mysql::mysql_interactive_worker] SELECT avg(number) FROM numbers(1000000);

The logs show that Databend has received the query, but it just stops there and seems to be waiting for some kind of event to happen.

If I use the Go standard library which retries every minute I'll observe the following logs:

[2021-11-28T06:34:55Z DEBUG common_clickhouse_srv] Handle New session
[2021-11-28T06:34:55Z DEBUG databend_query::servers::clickhouse::interactive_worker_base] SELECT VERSION()

[2021-11-28T06:35:55Z INFO  databend_query::servers::clickhouse::clickhouse_handler] ClickHouse connection coming: Ok(172.17.0.1:55228)
[2021-11-28T06:35:55Z DEBUG common_clickhouse_srv] Handle New session
[2021-11-28T06:35:55Z DEBUG databend_query::servers::clickhouse::interactive_worker_base] SELECT VERSION()



[2021-11-28T06:36:55Z INFO  databend_query::servers::clickhouse::clickhouse_handler] ClickHouse connection coming: Ok(172.17.0.1:55232)
[2021-11-28T06:36:55Z DEBUG common_clickhouse_srv] Handle New session
[2021-11-28T06:36:55Z DEBUG databend_query::servers::clickhouse::interactive_worker_base] SELECT VERSION()
@ZhiHanZ ZhiHanZ added the C-bug Category: something isn't working label Nov 28, 2021
@ZhiHanZ
Copy link
Collaborator

ZhiHanZ commented Nov 28, 2021

Hi @suzaku , not sure about your databend version for testing third party clients.
I have tested it manually on my local machine, and pymysql snippet works
Init a single node cluster

make cluster
# check on cluster healthiness
make cluster_view

Run python3 client query
image

Client library integration test is very important, which has not been finished yet and there are several issues related to it.
#1766
#1773

feel free to take those part if you are interested :)

@suzaku
Copy link
Author

suzaku commented Nov 28, 2021

The Databend server I connected was started with docker run --init --rm -p 9001:9001 -p 9191:9191 -p 3307:3307 datafuselabs/databend.

@suzaku
Copy link
Author

suzaku commented Nov 28, 2021

I would love to help, but it takes too long to compile a Rust project on my laptop and it starts to feel like a waste of time 🤣

@sundy-li
Copy link
Member

sundy-li commented Nov 28, 2021

It's true that the first time to build a large rust project takes a long time. But it'll be faster for increment building.
On my MacBook pro-2021, it needs 1-2 minutes to make debug from zero caches.

Thanks for the report, I'll try to reproduce it from your steps.

@sundy-li
Copy link
Member

docker run --init --rm -p 9001:9001 -p 9191:9191 -p 3307:3307 datafuselabs/databend

logs:

[2021-11-28T13:12:46Z INFO  databend_query] DatabendQuery v-0.1.0-9533dd1-simd(1.57.0-nightly-2021-10-26T01:51:09.305927968+00:00)

Seems the docker image is out of date, is this because we forgot to change the branch from master to main in databend-docker.yml? @ZhiHanZ

@ZhiHanZ
Copy link
Collaborator

ZhiHanZ commented Nov 28, 2021

please update the docker repo, which should be updated

docker run --init --rm -p 9001:9001 -p 9191:9191 -p 3307:3307 datafuselabs/databend

logs:

[2021-11-28T13:12:46Z INFO  databend_query] DatabendQuery v-0.1.0-9533dd1-simd(1.57.0-nightly-2021-10-26T01:51:09.305927968+00:00)

Seems the docker image is out of date, is this because we forgot to change the branch from master to main in databend-docker.yml? @ZhiHanZ

please update latest docker repo, which should get updated

@suzaku
Copy link
Author

suzaku commented Nov 28, 2021

Thanks. I'll try later. I guess in most cases, I don't really have to do extra setup to integrate Databend, right? I can just use it like a clickhouse server.

@ZhiHanZ
Copy link
Collaborator

ZhiHanZ commented Nov 28, 2021

Thanks. I'll try later. I guess in most cases, I don't really have to do extra setup to integrate Databend, right? I can just use it like a clickhouse server.

we maintain mysql and clickhouse protocol by default, feel free to open any issues on compatibility part.

@suzaku
Copy link
Author

suzaku commented Nov 28, 2021

Good to know that, thanks.

@Xuanwo Xuanwo closed this as not planned Won't fix, can't repro, duplicate, stale Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants