ydb-platform / ydb

YDB is an open source Distributed SQL Database that combines high availability and scalability with strong consistency and ACID transactions
https://ydb.tech
Apache License 2.0
3.98k stars 559 forks source link

Condition violated: `queryIt.second' in kqp_compile_service.cpp #6892

Open spuchin opened 3 months ago

spuchin commented 3 months ago

This error appeared in dev cluster, and it was returned constantly for a one of the queries Looks like we reached some inconsistent state in compile service.

Internal error during query compilation' [{'contrib/ydb/core/kqp/compile_service/kqp_compile_service.cpp:44: Condition violated: 'queryIt.second''

gridnevvvit commented 3 months ago
Jul 25 16:56:45 ydb-ru-prestable-myt-0016 kikimr_31023[1526794]: 2024-07-25T13:56:45.863170Z :KQP_COMPILE_SERVICE CRIT: Exception, scope: TEvCompileResponse, sender: [56090:7395572069688165182:46483], message: contrib/ydb/core/kqp/compile_service/kqp_compile_service.cpp:44: Condition violated: `queryIt.second'
Jul 25 16:56:45 ydb-ru-prestable-myt-0016 kikimr_31023[1526794]: 2024-07-25T13:56:45.863231Z :KQP_SESSION WARN: SessionId: ydb://session/3?node_id=56090&id=YTdmMTk2Y2EtODNkMDI0OWItMTVkZTkyMS1mZjBhYjEyNw==, ActorId: [56090:7395572069688165147:63716], ActorState: ExecuteState, TraceId: 01j3n2w43f6jvbc6bzkwmb6bmq, ReplyQueryCompileError, status INTERNAL_ERROR remove tx with tx_id:
Jul 25 16:56:45 ydb-ru-prestable-myt-0016 kikimr_31023[1526794]: 2024-07-25T13:56:45.863261Z :KQP_SESSION NOTICE: SessionId: ydb://session/3?node_id=56090&id=YTdmMTk2Y2EtODNkMDI0OWItMTVkZTkyMS1mZjBhYjEyNw==, ActorId: [56090:7395572069688165147:63716], ActorState: ExecuteState, TraceId: 01j3n2w43f6jvbc6bzkwmb6bmq, SessionActor destroyed due to INTERNAL_ERROR
rekby commented 2 months ago

I had reproduce of the problem today on dev cluster. I was happened after I re-create a table (drop table and create new with same name and same structure).

VPolka commented 2 months ago

Get queryIt.second' in kqp_compile_service.cpp:44 error if:

1) make request with user sid (it will be saved in queryId) 2) change table scheme 3) make the same request (it will be with recompilation, queryId with sid will be removed from cache and make new queryId without sid) 4) make the same request (it will be with sid and it doesn't find it in cache, then in cache will be 2 query Id with and without sid) 5) change table scheme 6) make the same request (it will be with recompilation, queryId with sid will be removed from cache and make new queryId without sid, then it will be compiled and try to put it in cache, but this queryId without sid is already in cache)

spuchin commented 1 month ago

Got another repo with high rate of errors:

Aug 29 14:28:15 host process[1980059]: 2024-08-29T11:28:15.687360Z :KQP_COMPILE_SERVICE CRIT: Exception, scope: TEvCompileResponse, sender: [7903:7408521781902442032:19332], message: contrib/ydb/core/kqp/compile_service/kqp_compile_service.cpp:44: Condition violated: `queryIt.second'
Aug 29 14:28:15 host process[1980059]: 2024-08-29T11:28:15.687418Z :KQP_SESSION WARN: SessionId: ydb://session/3?node_id=7903&id=YjM1ZWEwYjUtZGY1OWU5NzktOTQ4YjIxMmUtZWZkNTQzOTM=, ActorId: [7903:7408521764722548114:17985], ActorState: ExecuteState, TraceId: 01j6ey9brhc94jangwa0r66rcr, ReplyQueryCompileError, status INTERNAL_ERROR remove tx with tx_id: 
Aug 29 14:28:15 host process[1980059]: 2024-08-29T11:28:15.687488Z :KQP_SESSION NOTICE: SessionId: ydb://session/3?node_id=7903&id=YjM1ZWEwYjUtZGY1OWU5NzktOTQ4YjIxMmUtZWZkNTQzOTM=, ActorId: [7903:7408521764722548114:17985], ActorState: ExecuteState, TraceId: 01j6ey9brhc94jangwa0r66rcr, SessionActor destroyed due to INTERNAL_ERROR