-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
DB::Exception: Session is locked by a concurrent client. (SESSION_IS_LOCKED) #7906
Comments
Hi @ranjeetranjan 👋 Could you please provide more context here? |
Hi @igorlukanin I am getting below error in the cubejs
To dig into I open a discussion on the ClickHouse Slack community and they recommend
As per the Clickhouse community suggestion session_id should be unique. The same session ID creating issues. |
@ranjeetranjan Each connection in the connection pool allocated by Cube has a unique session_id. So, there is either a bug somewhere in connection pooling logic or there is some edge case with your workload that leads to the problem. Either way, we need a test to reproduce it as a first step. Also, a fix contribution would be helpful here as well. |
If you are interested in working on this issue, please provide go ahead and provide PR for that. |
@paveltiunov We utilize a Dashboard containing over 10 to 15 cards for data visualization. We run parallel requests for all these cards to efficiently retrieve and display the data on the Dashboard. It's observed that when parallel requests are made, they often share the same session ID, which could lead to conflicts or inconsistencies. Also we used to retry if we get the |
Hi, I have 2 cubes on 2 tables clickhouse. When I made a view joining the 2 cubes, I receive a error in my playground : The complete log on clickhouse side is :
@paveltiunov : I don't know how I can help in the resolution of this issue. We're all on premise so I can test further if it can help. |
@matthieuCarlini Thanks for adding some info here. I've tried to reproduce this in Cube Cloud on v0.36.3 with ClickHouse v24.10.1.243 in the following way but it worked without issues for me. Data model: cubes:
- name: countries
sql_table: countries
joins:
- name: country_codes
relationship: one_to_one
sql: "{countries.name} = {country_codes.name}"
dimensions:
- name: name
sql: name
type: string
- name: country_codes
sql_table: country_codes
dimensions:
- name: name
sql: name
type: string
- name: code
sql: code
type: string
views:
- name: country_info
cubes:
- join_path: countries
includes:
- name: name
alias: territory_name
- join_path: countries.country_codes
includes: '*' Query: {
"limit": 5000,
"dimensions": [
"country_info.territory_name",
"country_info.name",
"country_info.code"
]
} @matthieuCarlini @ranjeetranjan It would be great if you can help reproduce this. For starters, if you connect to this public ClickHouse server instead of your own one, are you able to reproduce this issue? |
@matthieuCarlini @igorlukanin Earlier I was using node:latest as build-step for the docker images but when I changed to cubejs/cube:v0.35.55 as docker images the same problem did not come. |
@igorlukanin : thanks for the test model online. |
@matthieuCarlini Thanks for the update! Indeed, joins in ClickHouse are an interesting thing 😄 @ranjeetranjan Do you think this was also an issue in your case? It would be great if you can test this on the latest version of Cube, because if this does not reproduce, then we'll call it a day and close this issue. |
@matthieuCarlini I wonder if this also deserves a ticket in ClickHouse repo, since the error message is so wildly different from the apparent root cause. |
@igorlukanin This came only when we had joins with lot of data but when we use cubejs/cube:v0.35.55 the issues did not came. After changing the build images #6477 also did not came. |
Whew! Looks like we can close this now. Thanks for collaborating, folks! |
@igorlukanin @ranjeetranjan I've been experiencing the same issue since Cube v0.36. v1.1: KO 🛑 |
@hungquach Let's wait for this PR to be merged and released, it might drastically improve how ClickHouse works with Cube: #8928 |
@hungquach I've just merged ClickHouse client upgrade, next release should have those changes included. I'll ping again when release is ready. |
@mcheshkov @igorlukanin thank you for the update. I will do some tests when the release is ready. |
v1.1.7 was just released, it's already available on Docker Hub, soon will be on Cloud. |
Getting error
To Reproduce
As per the CLickHouse expert
ClickHouse shows an error message if there are two or more parallel queries with the same session_id. Usually the session_id must be different each time
In details
The error occurs within ClickHouse's internals when a session is trying to be acquired, but it's already locked by another client. This might happen due to concurrent queries or operations trying to access the same session simultaneously, causing contention.
Version:
0.34.61
The text was updated successfully, but these errors were encountered: