-
Notifications
You must be signed in to change notification settings - Fork 231
Pgwatch2 1.9.0 : msg "WARN main: Could not find PG version info for DB" with monitored replica standby databases #520
Comments
Hello, can you, please, provide us with Docker compose file to reproduce the bug? Thanks in advance! |
Hello, Thank you for your feedback and sorry for my late reply. Here under is the way I've created and started the docker from the image cybertec/pgwatch2-postgres:1.9.0, with pooling (PW2_CONN_POOLING=on) and a PG database for storing metrics (PW2_PG_METRIC_STORE_CONN_STR) with TimescaleDB. docker run -d --restart=unless-stopped --name pw2_190_pg_tsdb_pool -p ... -p ... -e PW2_PGHOST=... -e PW2_PGPORT=... -e PW2_PGDATABASE=pgwatch2 -e PW2_PGUSER=pgwatch2 -e PW2_PGPASSWORD=.... -e PW2_DATASTORE=postgres -e PW2_PG_METRIC_STORE_CONN_STR="postgresql://pgwatch2:......@....:..../....." -e PW2_CONN_POOLING=on -e PW2_PG_RETENTION_DAYS=60 cybertec/pgwatch2-postgres:1.9.0 |
Hello, would you please test #551. Thanks in advance! |
Hello, I have tested your fix and it works well! Thank you very much for your attention and your work. Do you know why transactions are opened by pgwatch2 in case of pooling of sessions ? Have a good day, |
Cool! Pooling is a complicated story so to fine control what and how is going on pgwatch2 uses transactions in this mode. There are some comments and notices in the commit history about this. Thanks a lot for your help. |
[-] fix executing queries on standby databases with pooling, fixes #520
Looks like bug in lib/pq https://github.com/lib/pq/blob/d5affd5073b06f745459768de35356df2e5fd91d/conn_go18.go#L76
There is no default |
Hello.
We are using pgwatch2 1.8.5 and are currently evaluating the last version 1.9.0 of Pgwatch2 (v1.9.0#a0c546 (2022-04-25T14:35:52+02:00)) because we are very interested in the improvment of connexions pooling.
But we encountered a lot of errors "WARN main: Could not find PG version info for DB " when pgwatch2 connects on monitored databases that are replicas (e.G in recovery with ps_is_in_recovery()=true).
In the postgresql.log of PostgreSQL instance we see a lot of errors "user=pgwatch2,app=pgwatch2,client=****** ERROR: cannot set transaction read-write mode during recovery"**
So it seems like pgwatch2 1.9.0 doesn't take into account the fact that the monitored DB is in recovery mode (however this should be checked) and tries to open transactions in READ WRITE mode (rejected by the PostgreSQL DB instance of course).
Thanks a lot in advance for your help.
The text was updated successfully, but these errors were encountered: