chproxy icon indicating copy to clipboard operation
chproxy copied to clipboard

query_id not work

Open ddddddcf opened this issue 3 years ago • 8 comments

I send request with params {"query_id":"xxxxx"},but it doesn't work ,it always use scope_id please give me help ! thank you

ddddddcf avatar Apr 22 '22 04:04 ddddddcf

I saw the #47 issue , it was cancelled, so why

ddddddcf avatar Apr 24 '22 02:04 ddddddcf

when I use create table ... statement ,I can't get query_id from response headers

ddddddcf avatar Apr 26 '22 10:04 ddddddcf

FYI, this PR was managed by the previous owners of chproxy. We will need to take a bit of time to understand the reason why they didn't merge it.

mga-chka avatar Apr 28 '22 13:04 mga-chka

Hello @ddddddcf ,

today it does not work because chproxy uses its own generated query_id to kill queries exceeding timeouts.

... the generated query_id is used for query logging and cancellation. This means all the queries must have distinct query_id values. It is unclear how to ensure this when using the query_id provided by the client.

In the issue you linked hagen proposed a solution to that:

What if proxy will send generated query_id back in response headers?

would that work for you? It requires obviously code changes to chproxy, but it's the least impactful.

gontarzpawel avatar Jun 17 '22 10:06 gontarzpawel

I also need this function for using query_id with prefix for filter some query from system.query_log

xzy256 avatar Aug 04 '22 02:08 xzy256

I also need this function for using query_id with prefix for filter some query from system.query_log

The way I solved this problem was, put a unique comment in the query, sql like:

-- gu3sdusa1dusbfsub2-sdafasdf-sdfas2a-da
SELECT 1;

I can query by sql : select query from system.query_log where query like '%gu3sdusa1dusbfsub2-sdafasdf-sdfas2a-da%'

ddddddcf avatar Aug 04 '22 03:08 ddddddcf

I use http protocol not tcp, query_id is valid, when pass chproxy. So can't filter with select .... like

xzy256 avatar Aug 04 '22 03:08 xzy256

you can put a comment in SQL even with the http protocol

mga-chka avatar Sep 02 '22 09:09 mga-chka