postgres collector: Fix crash the wal query if wal-file was removed concurrently (#11697)
Oleg Volchkov committed
Oct 21, 2021 at 18:08 UTC
70ba124b63fc93256b2021692124cd8ca4c6b107
1 file changed
+2
-2
collectors/python.d.plugin/postgres/postgres.chart.py
+2
-2
@@ -196,7 +196,7 @@ FROM
196
FROM pg_catalog.pg_ls_dir('pg_wal') AS wal(name)
197
WHERE name ~ '^[0-9A-F]{24}$'
198
ORDER BY
199
- (pg_stat_file('pg_wal/'||name)).modification,
199
+ (pg_stat_file('pg_wal/'||name, true)).modification,
200
wal.name DESC) sub;
201
""",
202
V96: """
@@ -223,7 +223,7 @@ FROM
223
FROM pg_catalog.pg_ls_dir('pg_xlog') AS wal(name)
224
WHERE name ~ '^[0-9A-F]{24}$'
225
ORDER BY
226
- (pg_stat_file('pg_xlog/'||name)).modification,
226
+ (pg_stat_file('pg_xlog/'||name, true)).modification,
227
wal.name DESC) sub;
228
""",
229
}