Your message dated Sun, 22 Sep 2024 23:04:21 +0000
with message-id <[email protected]>
and subject line Bug#1071260: fixed in prometheus-postgres-exporter 0.15.0-4
has caused the Debian Bug report #1071260,
regarding prometheus-postgres-exporter: pg_replication_slots metrics query
fails on standbys with replication slots
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
1071260: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1071260
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: prometheus-postgres-exporter
Version: 0.11.1-3+b5
Severity: normal
Tags: patch
Hi,
if prometheus-postgres-exporter runs on a standby, and that standby has
physical replication slots, then the pg_replication_slots metrics queries
throws an error (see also upstream issues #547 [0] and #962 [1]):
|Mai 17 12:20:21 pg2 prometheus-postgres-exporter[8458]:
|ts=2024-05-17T10:20:21.162Z caller=namespace.go:236 level=info err="Error
|running query on database \"/var/run/postgresql/:5432\": pg_replication_slots
|pq: recovery is in progress"
This can be manually reproduced like this:
|postgres=# SELECT pg_create_physical_replication_slot('test');
| pg_create_physical_replication_slot
|-------------------------------------
| (test,)
|(1 row)
|
|postgres=# SELECT pg_is_in_recovery();
| pg_is_in_recovery
|-------------------
| t
|(1 row)
|
|postgres=# SELECT slot_name, database, active,
pg_wal_lsn_diff(pg_current_wal_lsn(), restart_lsn)
| FROM pg_replication_slots;
|ERROR: recovery is in progress
|HINT: WAL control functions cannot be executed during recovery.
Usually those functions like pg_current_wal_lsn() are guarded by CASE
pg_is_in_recovery(), but not here (maybe because it is not very common
to have replication slots on standbys). The attached patch should fix
it.
Michael
[0] https://github.com/prometheus-community/postgres_exporter/issues/547
[1] https://github.com/prometheus-community/postgres_exporter/issues/962
Index: prometheus-postgres-exporter-0.11.1/cmd/postgres_exporter/queries.go
===================================================================
--- prometheus-postgres-exporter-0.11.1.orig/cmd/postgres_exporter/queries.go
+++ prometheus-postgres-exporter-0.11.1/cmd/postgres_exporter/queries.go
@@ -105,14 +105,14 @@ var queryOverrides = map[string][]Overri
{
semver.MustParseRange(">=9.4.0 <10.0.0"),
`
- SELECT slot_name, database, active,
pg_xlog_location_diff(pg_current_xlog_location(), restart_lsn)
+ SELECT slot_name, database, active, (case
pg_is_in_recovery() when 't' then null else
pg_xlog_location_diff(pg_current_xlog_location(), restart_lsn) end)
FROM pg_replication_slots
`,
},
{
semver.MustParseRange(">=10.0.0"),
`
- SELECT slot_name, database, active,
pg_wal_lsn_diff(pg_current_wal_lsn(), restart_lsn)
+ SELECT slot_name, database, active, (case
pg_is_in_recovery() when 't' then null else
pg_wal_lsn_diff(pg_current_wal_lsn(), restart_lsn) end)
FROM pg_replication_slots
`,
},
--- End Message ---
--- Begin Message ---
Source: prometheus-postgres-exporter
Source-Version: 0.15.0-4
Done: Daniel Swarbrick <[email protected]>
We believe that the bug you reported is fixed in the latest version of
prometheus-postgres-exporter, which is due to be installed in the Debian FTP
archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Daniel Swarbrick <[email protected]> (supplier of updated
prometheus-postgres-exporter package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Format: 1.8
Date: Sun, 22 Sep 2024 22:14:46 +0000
Source: prometheus-postgres-exporter
Architecture: source
Version: 0.15.0-4
Distribution: unstable
Urgency: medium
Maintainer: Debian Go Packaging Team <[email protected]>
Changed-By: Daniel Swarbrick <[email protected]>
Closes: 1071260
Changes:
prometheus-postgres-exporter (0.15.0-4) unstable; urgency=medium
.
* Add new 0003-Cherry-pick-upstream-PR-1048.patch (Closes: #1071260)
* Bump Standards-Version to 4.7.0 (no changes)
Checksums-Sha1:
7c81bbef9d468aeabd70e29fc68b5da56c6fff90 2878
prometheus-postgres-exporter_0.15.0-4.dsc
5cd0c41f314687d156f52e57a6542368bb085751 9176
prometheus-postgres-exporter_0.15.0-4.debian.tar.xz
74de7a07652197a379d48e92f7264152e6ba0b54 9751
prometheus-postgres-exporter_0.15.0-4_amd64.buildinfo
Checksums-Sha256:
7b07cbb6829e0666bc9653fe0a3604c7fa60ec8ec5d70fa5e44820c6eead7588 2878
prometheus-postgres-exporter_0.15.0-4.dsc
4a704ba60aa5a2e59f0180fbbdb51c274cc69161a8204a52e72896d35fdfa727 9176
prometheus-postgres-exporter_0.15.0-4.debian.tar.xz
7047da8837633d1e5e3622b1558c2a822ce5a70655598791d3623ece7fcbd7ff 9751
prometheus-postgres-exporter_0.15.0-4_amd64.buildinfo
Files:
becaa86db20aeabc601aa5f058ce6246 2878 net optional
prometheus-postgres-exporter_0.15.0-4.dsc
62f35a23374a4b576d71101d0b932cc0 9176 net optional
prometheus-postgres-exporter_0.15.0-4.debian.tar.xz
28490fff8567cdaaf3226695bd4a1e77 9751 net optional
prometheus-postgres-exporter_0.15.0-4_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----
iQJKBAEBCgA0FiEEMD9oek78sa58GjWjtwAXP7uAWikFAmbwnMsWHGRzd2FyYnJp
Y2tAZGViaWFuLm9yZwAKCRC3ABc/u4BaKZypD/4toWI0qNBDrf4tf4KAf/Uapio4
nbPvjmpryeztfHiuZbVUZfQnCT/JoHTW9pSihssV1NtdcXDQf4kaZjXWL7+Z05xF
IkpIzL1M7Kn74ssGVlL0tNiZlWKcJhUzs0eNRaZnC1yDfF9+3bzWitCtPosjxfIf
xGVjaGp4mprEaAXewlnx653SC2lZLRY0zBavGBCWABU+Haj5WdWSWpKgEb6ZfdRF
dpwNq3345U3Pda7HckooMlsBXIcNuttUORwTZL5d6+kETLkMbGr7W4+UsCIGmd1v
F/227oT3c04bXrZ+Fv3BCPscNBCy9SGMR5aWah3WC39JGhLVMqkzYKubmU9n8AqU
Oqn2qWfv+IF4dXJIpA4QY5lv7V71BkQ6aTrjfGzKdysYI1ces5WNw4ueTWTStKky
s7VF7BLkctGs3u0VIEqt8FCFXff46+uf6it2r2MIsrLUNRHU/iS4ajXViCKtukxN
i5Za3rJpK6X4dEg2zU3wiwP/hEUFXIH2LpcAVDfZpfTkmLrxpx/01UCAZ+juP6my
37mfA85NiADEbXwVhuCWsliFHcIy0Tk+MyCIu6eqOgzjnVKSeGbROBwOnsdM5j+2
3VcJu/7zObDZd6ikYPNonlIUuuGJDyJuTBXR1eymW1R7WX9qZpWRH7dzDnILN37m
FmoVc7mYgdWFDeqc2Q==
=OLY4
-----END PGP SIGNATURE-----
pgpLX8QoCz46L.pgp
Description: PGP signature
--- End Message ---