postgresml/pgcat

pgbench fails when using prepared statement mode and multiple commands outside a transaction

Opened this issue · 5 comments

Describe the bug
Running pgbench with multiple commands outside of a transaction with prepared statements fails.

To Reproduce
Use the minimal config from the repo, but add prepared_statements = true.

$ cat select-2.sql
\set aid random(1, 100000 * :scale)
SELECT abalance FROM pgbench_accounts WHERE aid = :aid and 1  != 0;
SELECT abalance FROM pgbench_accounts WHERE aid = :aid and 2  != 0;
$ pgbench -i
$ pgbench -f select-2.sql --protocol prepared

Expected behavior
Not throw an error.

Actual behaviour

pgbench (15.3, server 12.16 (Ubuntu 12.16-1.pgdg22.04+1))
starting vacuum...end.
pgbench: error: client 0 script 0 aborted in command 0 query 0: FATAL:  error receiving data from server: SocketError("Error
reading message code from socket - Error Kind(UnexpectedEof)")
server closed the connection unexpectedly
    This probably means the server terminated abnormally
    before or while processing the request.
transaction type: select-20.sql
scaling factor: 1
query mode: prepared
number of clients: 1
number of threads: 1
maximum number of tries: 1
duration: 10 s
number of transactions actually processed: 0
number of failed transactions: 0 (NaN%)
pgbench: error: Run was aborted; the above results are incomplete.
2023-10-04T13:33:00.934067Z DEBUG ThreadId(06) pgcat::client: Password authentication successful
2023-10-04T13:33:00.934221Z DEBUG ThreadId(06) pgcat::client: Client 127.0.0.1:60206 connected (plain)
2023-10-04T13:33:00.983161Z DEBUG ThreadId(06) pgcat::query_router: Using pool settings, query_parser_enabled: false
2023-10-04T13:33:00.983260Z DEBUG ThreadId(06) pgcat::query_router: Regular query, not a command
2023-10-04T13:33:00.983284Z DEBUG ThreadId(06) pgcat::client: Waiting for connection from pool
2023-10-04T13:33:00.983308Z DEBUG ThreadId(06) pgcat::pool: Address { id: 0, host: "127.0.0.1", port: 5432, shard: 0, database: "postgres", role: Primary,
replica_number: 0, address_index: 0, username: "jelte", pool_name: "postgres", mirrors: [], stats: AddressStats { total: AddressStatFields { xact_count: 4, query_count: 4, bytes_received: 118, bytes_sent: 253, xact_time: 0, query_time: 16, wait_time: 403, errors: 0 }, current: AddressStatFields { xact_count:
4, query_count: 4, bytes_received: 118, bytes_sent: 253, xact_time: 0, query_time: 16, wait_time: 403, errors: 0 }, averages: AddressStatFields { xact_count: 0, query_count: 0, bytes_received: 0, bytes_sent: 0, xact_time: 0, query_time: 0, wait_time: 0, errors: 0 }, averages_updated: false }, error_count: 1 } is ok
2023-10-04T13:33:00.983495Z  INFO ThreadId(06) pgcat::pool: Creating a new server connection Address { id: 0, host: "127.0.0.1", port: 5432, shard: 0, database: "postgres", role: Primary, replica_number: 0, address_index: 0, username: "jelte", pool_name: "postgres", mirrors: [], stats: AddressStats { total: AddressStatFields { xact_count: 4, query_count: 4, bytes_received: 118, bytes_sent: 253, xact_time: 0, query_time: 16, wait_time: 403, errors: 0 }, current: AddressStatFields { xact_count: 4, query_count: 4, bytes_received: 118, bytes_sent: 253, xact_time: 0, query_time: 16, wait_time: 403, errors: 0 }, averages: AddressStatFields { xact_count: 0, query_count: 0, bytes_received: 0, bytes_sent: 0, xact_time: 0, query_time: 0, wait_time: 0, errors: 0 }, averages_updated: false }, error_count: 1 }
2023-10-04T13:33:00.988415Z DEBUG ThreadId(04) pgcat::client: Got connection from pool
2023-10-04T13:33:00.988507Z DEBUG ThreadId(04) pgcat::client: Client 127.0.0.1:60206 talking to server Address { id: 0, host: "127.0.0.1", port: 5432, shard: 0, database: "postgres", role: Primary, replica_number: 0, address_index: 0, username: "jelte", pool_name: "postgres", mirrors: [], stats: AddressStats
{ total: AddressStatFields { xact_count: 4, query_count: 4, bytes_received: 118, bytes_sent: 253, xact_time: 0, query_time: 16, wait_time: 5494, errors: 0
}, current: AddressStatFields { xact_count: 4, query_count: 4, bytes_received: 118, bytes_sent: 253, xact_time: 0, query_time: 16, wait_time: 5494, errors: 0 }, averages: AddressStatFields { xact_count: 0, query_count: 0, bytes_received: 0, bytes_sent: 0, xact_time: 0, query_time: 0, wait_time: 0, errors: 0 }, averages_updated: false }, error_count: 0 }
2023-10-04T13:33:00.988553Z DEBUG ThreadId(04) pgcat::server: Running `SET application_name TO 'pgbench';` on server Address { id: 0, host: "127.0.0.1", port: 5432, shard: 0, database: "postgres", role: Primary, replica_number: 0, address_index: 0, username: "jelte", pool_name: "postgres", mirrors: [], stats: AddressStats { total: AddressStatFields { xact_count: 4, query_count: 4, bytes_received: 118, bytes_sent: 253, xact_time: 0, query_time: 16, wait_time: 5494, errors: 0 }, current: AddressStatFields { xact_count: 4, query_count: 4, bytes_received: 118, bytes_sent: 253, xact_time: 0, query_time: 16, wait_time: 5494, errors: 0 }, averages: AddressStatFields { xact_count: 0, query_count: 0, bytes_received: 0, bytes_sent: 0, xact_time: 0, query_time: 0, wait_time:
0, errors: 0 }, averages_updated: false }, error_count: 0 }
2023-10-04T13:33:00.989031Z DEBUG ThreadId(04) pgcat::server: Server connection marked for clean up
2023-10-04T13:33:00.989138Z DEBUG ThreadId(04) pgcat::client: Prepared statement active: None
2023-10-04T13:33:00.989153Z DEBUG ThreadId(04) pgcat::query_router: Using pool settings, query_parser_enabled: false
2023-10-04T13:33:00.989162Z DEBUG ThreadId(04) pgcat::client: Sending query to server
2023-10-04T13:33:00.989170Z DEBUG ThreadId(04) pgcat::client: Sending Q to server
2023-10-04T13:33:01.001151Z DEBUG ThreadId(04) pgcat::server: Server in transaction: false
2023-10-04T13:33:01.001234Z DEBUG ThreadId(04) pgcat::client: Releasing server back into the pool
2023-10-04T13:33:01.001249Z DEBUG ThreadId(04) pgcat::server: Server in transaction: false
2023-10-04T13:33:01.001258Z DEBUG ThreadId(04) pgcat::server: Cache maintenance run
2023-10-04T13:33:01.001317Z DEBUG ThreadId(04) pgcat::query_router: Using pool settings, query_parser_enabled: false
2023-10-04T13:33:01.001451Z DEBUG ThreadId(04) pgcat::query_router: Regular query, not a command
2023-10-04T13:33:01.001513Z DEBUG ThreadId(04) pgcat::client: Waiting for connection from pool
2023-10-04T13:33:01.001531Z DEBUG ThreadId(04) pgcat::pool: Address { id: 0, host: "127.0.0.1", port: 5432, shard: 0, database: "postgres", role: Primary,
replica_number: 0, address_index: 0, username: "jelte", pool_name: "postgres", mirrors: [], stats: AddressStats { total: AddressStatFields { xact_count: 5, query_count: 5, bytes_received: 181, bytes_sent: 322, xact_time: 0, query_time: 27, wait_time: 5494, errors: 0 }, current: AddressStatFields { xact_count: 5, query_count: 5, bytes_received: 181, bytes_sent: 322, xact_time: 0, query_time: 27, wait_time: 5494, errors: 0 }, averages: AddressStatFields { xact_count: 0, query_count: 0, bytes_received: 0, bytes_sent: 0, xact_time: 0, query_time: 0, wait_time: 0, errors: 0 }, averages_updated: false }, error_count: 0 } is ok
2023-10-04T13:33:01.001565Z DEBUG ThreadId(04) pgcat::client: Got connection from pool
2023-10-04T13:33:01.001574Z DEBUG ThreadId(04) pgcat::client: Client 127.0.0.1:60206 talking to server Address { id: 0, host: "127.0.0.1", port: 5432, shard: 0, database: "postgres", role: Primary, replica_number: 0, address_index: 0, username: "jelte", pool_name: "postgres", mirrors: [], stats: AddressStats
{ total: AddressStatFields { xact_count: 5, query_count: 5, bytes_received: 181, bytes_sent: 322, xact_time: 0, query_time: 27, wait_time: 5525, errors: 0
}, current: AddressStatFields { xact_count: 5, query_count: 5, bytes_received: 181, bytes_sent: 322, xact_time: 0, query_time: 27, wait_time: 5525, errors: 0 }, averages: AddressStatFields { xact_count: 0, query_count: 0, bytes_received: 0, bytes_sent: 0, xact_time: 0, query_time: 0, wait_time: 0, errors: 0 }, averages_updated: false }, error_count: 0 }
2023-10-04T13:33:01.001650Z DEBUG ThreadId(04) pgcat::client: Prepared statement active: None
2023-10-04T13:33:01.001723Z DEBUG ThreadId(04) pgcat::query_router: Using pool settings, query_parser_enabled: false
2023-10-04T13:33:01.001802Z DEBUG ThreadId(04) pgcat::client: Sending query to server
2023-10-04T13:33:01.001816Z DEBUG ThreadId(04) pgcat::client: Sending Q to server
2023-10-04T13:33:01.003227Z DEBUG ThreadId(04) pgcat::server: Server in transaction: false
2023-10-04T13:33:01.003328Z DEBUG ThreadId(04) pgcat::client: Releasing server back into the pool
2023-10-04T13:33:01.003421Z DEBUG ThreadId(04) pgcat::server: Server in transaction: false
2023-10-04T13:33:01.003503Z DEBUG ThreadId(04) pgcat::server: Cache maintenance run
2023-10-04T13:33:01.003663Z DEBUG ThreadId(04) pgcat::query_router: Using pool settings, query_parser_enabled: false
2023-10-04T13:33:01.003775Z DEBUG ThreadId(04) pgcat::query_router: Regular query, not a command
2023-10-04T13:33:01.003862Z DEBUG ThreadId(04) pgcat::client: Waiting for connection from pool
2023-10-04T13:33:01.003959Z DEBUG ThreadId(04) pgcat::pool: Address { id: 0, host: "127.0.0.1", port: 5432, shard: 0, database: "postgres", role: Primary,
replica_number: 0, address_index: 0, username: "jelte", pool_name: "postgres", mirrors: [], stats: AddressStats { total: AddressStatFields { xact_count: 6, query_count: 6, bytes_received: 199, bytes_sent: 350, xact_time: 0, query_time: 28, wait_time: 5525, errors: 0 }, current: AddressStatFields { xact_count: 6, query_count: 6, bytes_received: 199, bytes_sent: 350, xact_time: 0, query_time: 28, wait_time: 5525, errors: 0 }, averages: AddressStatFields { xact_count: 0, query_count: 0, bytes_received: 0, bytes_sent: 0, xact_time: 0, query_time: 0, wait_time: 0, errors: 0 }, averages_updated: false }, error_count: 0 } is ok
2023-10-04T13:33:01.004084Z DEBUG ThreadId(04) pgcat::client: Got connection from pool
2023-10-04T13:33:01.004166Z DEBUG ThreadId(04) pgcat::client: Client 127.0.0.1:60206 talking to server Address { id: 0, host: "127.0.0.1", port: 5432, shard: 0, database: "postgres", role: Primary, replica_number: 0, address_index: 0, username: "jelte", pool_name: "postgres", mirrors: [], stats: AddressStats
{ total: AddressStatFields { xact_count: 6, query_count: 6, bytes_received: 199, bytes_sent: 350, xact_time: 0, query_time: 28, wait_time: 5646, errors: 0
}, current: AddressStatFields { xact_count: 6, query_count: 6, bytes_received: 199, bytes_sent: 350, xact_time: 0, query_time: 28, wait_time: 5646, errors: 0 }, averages: AddressStatFields { xact_count: 0, query_count: 0, bytes_received: 0, bytes_sent: 0, xact_time: 0, query_time: 0, wait_time: 0, errors: 0 }, averages_updated: false }, error_count: 0 }
2023-10-04T13:33:01.004281Z DEBUG ThreadId(04) pgcat::client: Prepared statement active: None
2023-10-04T13:33:01.004362Z DEBUG ThreadId(04) pgcat::query_router: Using pool settings, query_parser_enabled: false
2023-10-04T13:33:01.004382Z DEBUG ThreadId(04) pgcat::client: Sending query to server
2023-10-04T13:33:01.004395Z DEBUG ThreadId(04) pgcat::client: Sending Q to server
2023-10-04T13:33:01.011365Z DEBUG ThreadId(04) pgcat::server: Server in transaction: false
2023-10-04T13:33:01.011448Z DEBUG ThreadId(04) pgcat::client: Releasing server back into the pool
2023-10-04T13:33:01.011466Z DEBUG ThreadId(04) pgcat::server: Server in transaction: false
2023-10-04T13:33:01.011476Z DEBUG ThreadId(04) pgcat::server: Cache maintenance run
2023-10-04T13:33:01.011542Z DEBUG ThreadId(04) pgcat::client: Client disconnecting
2023-10-04T13:33:01.011788Z DEBUG ThreadId(04) pgcat: Client 127.0.0.1:60206 disconnected, session duration: 0d 00:00:00.080
2023-10-04T13:33:01.013419Z DEBUG ThreadId(06) pgcat::client: Password authentication successful
2023-10-04T13:33:01.013603Z DEBUG ThreadId(06) pgcat::client: Client 127.0.0.1:60220 connected (plain)
2023-10-04T13:33:01.062869Z DEBUG ThreadId(06) pgcat::client: Renamed prepared statement `P_0` to `P_1` and saved to cache
2023-10-04T13:33:01.062936Z DEBUG ThreadId(06) pgcat::query_router: Using pool settings, query_parser_enabled: false
2023-10-04T13:33:01.062955Z DEBUG ThreadId(06) pgcat::client: Waiting for connection from pool
2023-10-04T13:33:01.062964Z DEBUG ThreadId(06) pgcat::pool: Address { id: 0, host: "127.0.0.1", port: 5432, shard: 0, database: "postgres", role: Primary,
replica_number: 0, address_index: 0, username: "jelte", pool_name: "postgres", mirrors: [], stats: AddressStats { total: AddressStatFields { xact_count: 7, query_count: 7, bytes_received: 225, bytes_sent: 380, xact_time: 0, query_time: 34, wait_time: 5646, errors: 0 }, current: AddressStatFields { xact_count: 7, query_count: 7, bytes_received: 225, bytes_sent: 380, xact_time: 0, query_time: 34, wait_time: 5646, errors: 0 }, averages: AddressStatFields { xact_count: 0, query_count: 0, bytes_received: 0, bytes_sent: 0, xact_time: 0, query_time: 0, wait_time: 0, errors: 0 }, averages_updated: false }, error_count: 0 } is ok
2023-10-04T13:33:01.063030Z DEBUG ThreadId(06) pgcat::client: Got connection from pool
2023-10-04T13:33:01.063085Z DEBUG ThreadId(06) pgcat::client: Client 127.0.0.1:60220 talking to server Address { id: 0, host: "127.0.0.1", port: 5432, shard: 0, database: "postgres", role: Primary, replica_number: 0, address_index: 0, username: "jelte", pool_name: "postgres", mirrors: [], stats: AddressStats
{ total: AddressStatFields { xact_count: 7, query_count: 7, bytes_received: 225, bytes_sent: 380, xact_time: 0, query_time: 34, wait_time: 5706, errors: 0
}, current: AddressStatFields { xact_count: 7, query_count: 7, bytes_received: 225, bytes_sent: 380, xact_time: 0, query_time: 34, wait_time: 5706, errors: 0 }, averages: AddressStatFields { xact_count: 0, query_count: 0, bytes_received: 0, bytes_sent: 0, xact_time: 0, query_time: 0, wait_time: 0, errors: 0 }, averages_updated: false }, error_count: 0 }
2023-10-04T13:33:01.063155Z DEBUG ThreadId(06) pgcat::client: Prepared statement active: Some("P_0")
2023-10-04T13:33:01.063208Z DEBUG ThreadId(06) pgcat::client: Checking prepared statement is on server
2023-10-04T13:33:01.063220Z DEBUG ThreadId(06) pgcat::client: Prepared statement `P_0` found in cache
2023-10-04T13:33:01.063264Z DEBUG ThreadId(06) pgcat::server: Will prepare `P_1`
2023-10-04T13:33:01.063313Z DEBUG ThreadId(06) pgcat::client: Sending query to server
2023-10-04T13:33:01.063328Z DEBUG ThreadId(06) pgcat::client: Sending S to server
2023-10-04T13:33:01.064069Z DEBUG ThreadId(06) pgcat::server: Server in transaction: false
2023-10-04T13:33:01.064126Z DEBUG ThreadId(06) pgcat::client: Releasing server back into the pool
2023-10-04T13:33:01.064142Z DEBUG ThreadId(06) pgcat::server: Server in transaction: false
2023-10-04T13:33:01.064191Z DEBUG ThreadId(06) pgcat::server: Cache maintenance run
2023-10-04T13:33:01.064296Z DEBUG ThreadId(06) pgcat::client: Rewrote bind `P_0` to `P_1`
2023-10-04T13:33:01.064352Z DEBUG ThreadId(06) pgcat::query_router: Using pool settings, query_parser_enabled: false
2023-10-04T13:33:01.064375Z DEBUG ThreadId(06) pgcat::client: Anonymous describe
2023-10-04T13:33:01.064439Z DEBUG ThreadId(06) pgcat::client: Waiting for connection from pool
2023-10-04T13:33:01.064490Z DEBUG ThreadId(06) pgcat::pool: Address { id: 0, host: "127.0.0.1", port: 5432, shard: 0, database: "postgres", role: Primary,
replica_number: 0, address_index: 0, username: "jelte", pool_name: "postgres", mirrors: [], stats: AddressStats { total: AddressStatFields { xact_count: 8, query_count: 8, bytes_received: 236, bytes_sent: 462, xact_time: 0, query_time: 34, wait_time: 5706, errors: 0 }, current: AddressStatFields { xact_count: 8, query_count: 8, bytes_received: 236, bytes_sent: 462, xact_time: 0, query_time: 34, wait_time: 5706, errors: 0 }, averages: AddressStatFields { xact_count: 0, query_count: 0, bytes_received: 0, bytes_sent: 0, xact_time: 0, query_time: 0, wait_time: 0, errors: 0 }, averages_updated: false }, error_count: 0 } is ok
2023-10-04T13:33:01.064556Z DEBUG ThreadId(06) pgcat::client: Got connection from pool
2023-10-04T13:33:01.064613Z DEBUG ThreadId(06) pgcat::client: Client 127.0.0.1:60220 talking to server Address { id: 0, host: "127.0.0.1", port: 5432, shard: 0, database: "postgres", role: Primary, replica_number: 0, address_index: 0, username: "jelte", pool_name: "postgres", mirrors: [], stats: AddressStats
{ total: AddressStatFields { xact_count: 8, query_count: 8, bytes_received: 236, bytes_sent: 462, xact_time: 0, query_time: 34, wait_time: 5767, errors: 0
}, current: AddressStatFields { xact_count: 8, query_count: 8, bytes_received: 236, bytes_sent: 462, xact_time: 0, query_time: 34, wait_time: 5767, errors: 0 }, averages: AddressStatFields { xact_count: 0, query_count: 0, bytes_received: 0, bytes_sent: 0, xact_time: 0, query_time: 0, wait_time: 0, errors: 0 }, averages_updated: false }, error_count: 0 }
2023-10-04T13:33:01.064670Z DEBUG ThreadId(06) pgcat::client: Prepared statement active: Some("P_0")
2023-10-04T13:33:01.064712Z DEBUG ThreadId(06) pgcat::client: Checking prepared statement is on server
2023-10-04T13:33:01.064732Z DEBUG ThreadId(06) pgcat::client: Prepared statement `P_0` found in cache
2023-10-04T13:33:01.064771Z DEBUG ThreadId(06) pgcat::server: Should prepare `P_1`: false
2023-10-04T13:33:01.064789Z DEBUG ThreadId(06) pgcat::client: Sending query to server
2023-10-04T13:33:01.064838Z DEBUG ThreadId(06) pgcat::client: Sending S to server
2023-10-04T13:33:01.068199Z ERROR ThreadId(06) pgcat::server: Terminating server Address { id: 0, host: "127.0.0.1", port: 5432, shard: 0, database: "postgres", role: Primary, replica_number: 0, address_index: 0, username: "jelte", pool_name: "postgres", mirrors: [], stats: AddressStats { total: AddressStatFields { xact_count: 8, query_count: 8, bytes_received: 236, bytes_sent: 506, xact_time: 0, query_time: 34, wait_time: 5767, errors: 0 }, current: AddressStatFields { xact_count: 8, query_count: 8, bytes_received: 236, bytes_sent: 506, xact_time: 0, query_time: 34, wait_time: 5767, errors: 0 }, averages: AddressStatFields { xact_count: 0, query_count: 0, bytes_received: 0, bytes_sent: 0, xact_time: 0, query_time: 0, wait_time: 0, errors: 0 }, averages_updated: false }, error_count: 0 } because of: SocketError("Error reading message code from socket - Error Kind(UnexpectedEof)")
2023-10-04T13:33:01.068401Z  INFO ThreadId(06) pgcat::server: Server connection terminated Address { id: 0, host: "127.0.0.1", port: 5432, shard: 0, database: "postgres", role: Primary, replica_number: 0, address_index: 0, username: "jelte", pool_name: "postgres", mirrors: [], stats: AddressStats { total: AddressStatFields { xact_count: 8, query_count: 8, bytes_received: 236, bytes_sent: 506, xact_time: 0, query_time: 34, wait_time: 5767, errors: 0 }, current:
AddressStatFields { xact_count: 8, query_count: 8, bytes_received: 236, bytes_sent: 506, xact_time: 0, query_time: 34, wait_time: 5767, errors: 0 }, averages: AddressStatFields { xact_count: 0, query_count: 0, bytes_received: 0, bytes_sent: 0, xact_time: 0, query_time: 0, wait_time: 0, errors: 0 }, averages_updated: false }, error_count: 1 }, session duration: 0d 00:00:00.080
2023-10-04T13:33:01.068601Z  WARN ThreadId(06) pgcat: Client disconnected with error SocketError("Error reading message code from socket - Error Kind(UnexpectedEof)")

Prepared expressions are not supported in transaction mode. That's probably the problem

They are supported. This is probably a bug we need to chase down.

Ran into some prepared statement issues myself.

To enable Prepared Statements you need to:

  • be in session mode or
  • add prepared_statements_cache_size = {N} to your config.

prepared_statements_enabled is not actually loaded from config.

It is set inside client.rs:

         let transaction_mode = pool.settings.pool_mode == PoolMode::Transaction;
         prepared_statements_enabled = transaction_mode && pool.prepared_statement_cache.is_some();

@levkk Happy to make a PR, but what should the expected behaviour be?

have some error to

pgcat --version: pgcat 1.1.2-dev4

my config:

[general]

host = "0.0.0.0"
port = 5433
enable_prometheus_exporter = false
prometheus_exporter_port = 9930
connect_timeout = 3000 # milliseconds
idle_timeout = 120 # milliseconds
server_lifetime = 86400000 # 24 hours
idle_client_in_transaction_timeout = 0 # milliseconds
healthcheck_timeout = 3000 # milliseconds
healthcheck_delay = 30000 # milliseconds
shutdown_timeout = 60000 # milliseconds
ban_time = 60 # seconds
log_client_connections = false
log_client_disconnections = false
autoreload = 15000
worker_threads = 16
tcp_keepalives_idle = 3
tcp_keepalives_count = 3
tcp_keepalives_interval = 3
server_tls = false
verify_server_certificate = false
admin_username = "myadmin"
admin_password = "myadminpass"

[pools.mypoll]

pool_mode = "transaction"
load_balancing_mode = "loc"
default_role = "any"
prepared_statements = true
prepared_statements_cache_size = 1000 # bytes?
query_parser_enabled = false
query_parser_read_write_splitting = false
primary_reads_enabled = true
sharding_function = "pg_bigint_hash"
idle_timeout = 40000
connect_timeout = 3000

[pools.mypoll.shards.0]

servers = [["127.0.0.1", 5432, "primary"]]
database = "mydb"

[pools.mypoll.users.0]

username = "mydb"
password = "mydbpass"
pool_size = 1000000
statement_timeout = 0

pgcat log

Jun 10 08:28:40 rvm24 pgcat[803656]: #033[2m2024-06-10T08:28:40.483554Z#033[0m #033[33m WARN#033[0m ThreadId(15) #033[2mpgcat#033[0m#033[2m:#033[0m Client disconnected with error SocketError("Error reading message code from socket - Error Kind(UnexpectedEof)")
Jun 10 08:28:51 rvm24 pgcat[803656]: #033[2m2024-06-10T08:28:51.883512Z#033[0m #033[33m WARN#033[0m ThreadId(18) #033[2mpgcat#033[0m#033[2m:#033[0m Client disconnected with error SocketError("Error reading message code from socket - Error Kind(UnexpectedEof)")
Jun 10 08:29:04 rvm24 pgcat[803656]: #033[2m2024-06-10T08:29:04.179101Z#033[0m #033[33m WARN#033[0m ThreadId(15) #033[2mpgcat#033[0m#033[2m:#033[0m Client disconnected with error SocketError("Error reading message code from socket - Error Kind(UnexpectedEof)")
Jun 10 08:29:17 rvm24 pgcat[803656]: #033[2m2024-06-10T08:29:17.081964Z#033[0m #033[33m WARN#033[0m ThreadId(15) #033[2mpgcat#033[0m#033[2m:#033[0m Client disconnected with error SocketError("Error reading message code from socket - Error Kind(UnexpectedEof)")
Jun 10 08:29:27 rvm24 pgcat[803656]: #033[2m2024-06-10T08:29:27.598001Z#033[0m #033[33m WARN#033[0m ThreadId(18) #033[2mpgcat#033[0m#033[2m:#033[0m Client disconnected with error SocketError("Error reading message code from socket - Error Kind(UnexpectedEof)")
Jun 10 08:29:30 rvm24 pgcat[803656]: #033[2m2024-06-10T08:29:30.970949Z#033[0m #033[33m WARN#033[0m ThreadId(18) #033[2mpgcat#033[0m#033[2m:#033[0m Client disconnected with error SocketError("Error reading message code from socket - Error Kind(UnexpectedEof)")
Jun 10 08:29:35 rvm24 pgcat[803656]: #033[2m2024-06-10T08:29:35.824437Z#033[0m #033[33m WARN#033[0m ThreadId(15) #033[2mpgcat#033[0m#033[2m:#033[0m Client disconnected with error SocketError("Error reading message code from socket - Error Kind(UnexpectedEof)")
Jun 10 08:29:58 rvm24 pgcat[803656]: #033[2m2024-06-10T08:29:58.641439Z#033[0m #033[33m WARN#033[0m ThreadId(18) #033[2mpgcat#033[0m#033[2m:#033[0m Client disconnected with error SocketError("Error reading message code from socket - Error Kind(UnexpectedEof)")
Jun 10 08:30:09 rvm24 pgcat[803656]: #033[2m2024-06-10T08:30:09.870358Z#033[0m #033[33m WARN#033[0m ThreadId(15) #033[2mpgcat#033[0m#033[2m:#033[0m Client disconnected with error SocketError("Error reading message code from socket - Error Kind(UnexpectedEof)")
Jun 10 08:30:15 rvm24 pgcat[803656]: #033[2m2024-06-10T08:30:15.022998Z#033[0m #033[33m WARN#033[0m ThreadId(15) #033[2mpgcat#033[0m#033[2m:#033[0m Client disconnected with error SocketError("Error reading message code from socket - Error Kind(UnexpectedEof)")
Jun 10 08:30:28 rvm24 pgcat[803656]: #033[2m2024-06-10T08:30:28.515409Z#033[0m #033[33m WARN#033[0m ThreadId(18) #033[2mpgcat#033[0m#033[2m:#033[0m Client disconnected with error SocketError("Error reading message code from socket - Error Kind(UnexpectedEof)")
Jun 10 08:30:33 rvm24 pgcat[803656]: #033[2m2024-06-10T08:30:33.695416Z#033[0m #033[33m WARN#033[0m ThreadId(18) #033[2mpgcat#033[0m#033[2m:#033[0m Client disconnected with error SocketError("Error reading message code from socket - Error Kind(UnexpectedEof)")

posrgresql 14 log so clear

2024-06-10 08:06:51.568 UTC [803554] LOG:  starting PostgreSQL 14.12 (Ubuntu 14.12-0ubuntu0.22.04.1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, 64-bit
2024-06-10 08:06:51.568 UTC [803554] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2024-06-10 08:06:51.568 UTC [803554] LOG:  listening on IPv6 address "::", port 5432
2024-06-10 08:06:51.581 UTC [803554] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-06-10 08:06:51.606 UTC [803555] LOG:  database system was shut down at 2024-06-10 08:06:46 UTC
2024-06-10 08:06:51.639 UTC [803554] LOG:  database system is ready to accept connections

https://www.postgresql.org/docs/current/runtime-config-resource.html#GUC-MAX-PREPARED-TRANSACTIONS

maybe in pg max_prepared_transactions default is 0 (disabled) ?

udp:
set max_prepared_transactions = 1024 in pg conf not supported - pgcat error in log dnt disappeared.

udp1:
new errors

Jun 10 11:34:12 rvm24 pgcat[805450]: #033[2m2024-06-10T11:34:12.626533Z#033[0m #033[32m INFO#033[0m ThreadId(07) #033[2mpgcat::server::cleanup#033[0m#033[2m:#033[0m Server returned with session state altered, discarding state (SET: true, PREPARE: false) for application pgcat
Jun 10 11:34:12 rvm24 pgcat[805450]: #033[2m2024-06-10T11:34:12.670471Z#033[0m #033[32m INFO#033[0m ThreadId(07) #033[2mpgcat::server::cleanup#033[0m#033[2m:#033[0m Server returned with session state altered, discarding state (SET: true, PREPARE: false) for application pgcat
Jun 10 11:34:12 rvm24 pgcat[805450]: #033[2m2024-06-10T11:34:12.760395Z#033[0m #033[32m INFO#033[0m ThreadId(07) #033[2mpgcat::server::cleanup#033[0m#033[2m:#033[0m Server returned with session state altered, discarding state (SET: true, PREPARE: false) for application pgcat