Skip to content

Commit

Permalink
fix(monitor): amend inactive replication slot query to ignore non-spe…
Browse files Browse the repository at this point in the history
…ckle slots (#3857)
  • Loading branch information
iainsproat authored Jan 21, 2025
1 parent 347fa4b commit bb9f112
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const init: MetricInitializer = (config) => {
const connectionResults = await client.raw<{
rows: [{ inactive_replication_slots: string }]
}>(
`SELECT count(*) AS inactive_replication_slots FROM pg_replication_slots WHERE NOT active;`
`SELECT count(*) AS inactive_replication_slots FROM pg_replication_slots WHERE slot_type = 'logical' AND (slot_name LIKE 'projectsub_%' OR slot_name LIKE 'userssub_%') AND NOT active;`
)
if (!connectionResults.rows.length) {
logger.error(
Expand Down

0 comments on commit bb9f112

Please sign in to comment.