Open wenym1 opened 1 week ago
The stuck can not be resolved automatically.
The solution to it is to first run select * from pg_stat_activity;
to inspect the status of all connections. From the query result, filter out rows with application_name
as PostgreSQL JDBC Driver
. In the remaining rows, find out rows that has wait_event
as ClientWrite
, state
as active
and query
as a prepared DML statement. These rows are likely to be the problematic connections. We can get the pid
of these connections, and call SELECT pg_terminate_backend(<pid>)
to kill the connections so that the jdbc sink can be unstuck and trigger retry.
Nevertheless, we still need to figure out why the connection is stuck.
cc @StrikeW @hzxa21
Maybe related: https://github.com/pgjdbc/pgjdbc/issues/194
Maybe related: pgjdbc/pgjdbc#194
I think so. The stack trace is similar to https://github.com/pgjdbc/pgjdbc/issues/194#issuecomment-2163403910. I am not very sure whether rewrite to Rust could improve the stability (https://github.com/risingwavelabs/risingwave/issues/16745). cc @fuyufjh to take a look of the priority.
Maybe related: pgjdbc/pgjdbc#194
I think so. The stack trace is similar to pgjdbc/pgjdbc#194 (comment). I am not very sure whether rewrite to Rust could improve the stability (#16745). cc @fuyufjh to take a look of the priority.
I don't see user reporting issues related to stuck query in https://github.com/sfackler/rust-postgres/issues so I am optimistic about using rust to sink to PG can be more stable.
The issue with java/jdbc is that it is difficult (even impossible) to timeout a query because stmt.executeBatch()
is not async and we cannot implement our own timeout mechanism as a safeguard to cancel the query and retry.
Describe the bug
On a postgresql jdbc sink
log store read epoch does not increase for a long time
await-tree dump
jstack
The code that gets stuck
The
0
timeout is hard coded, so it's unlikely to add timeout with some config.Error message/log
No response
To Reproduce
No response
Expected behavior
No response
How did you deploy RisingWave?
No response
The version of RisingWave
No response
Additional context
IMAGE: v1.10.1-patch-us-west-2-35-fix-serving-mapping