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
4k stars 565 forks source link

[pg] Handle BAD_SESSION status #2963

Closed rekby closed 7 months ago

rekby commented 7 months ago

Run on ydb-local https://github.com/ydb-platform/ydb/wiki/Local-run-postgres-tests

echo "asd; SELECT 1" | psql postgres://root:1234@localhost:5432/local

Result:

Status: INTERNAL_ERROR
Issues:
<main>: Error: Error while parsing query.
    <main>:1:2: Error: ERROR:  syntax error at or near "asd"

Status: BAD_SESSION
Issues:
<main>: Error: Session not found: ydb://session/3?node_id=1&id=NTg3ODA5ZDItYWJiMTcwODEtOWFmYzNkNDAtZTVjM2U2YjI=

Expected behaviour: Close TCP connection after INTERNAL_ERROR (better) or BAD_SESSION (acceptable) - as signal for client for reconnect.

Reason: Now client library can't continue to work and will always receive error for died session, but can't know about it because connection alive.

adameat commented 7 months ago

could you please fill in some details? it's not clear to me

rekby commented 7 months ago

Duplicate of to https://github.com/ydb-platform/ydb/issues/2898