mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 00:26:30 +00:00
Don't check status of logical replication slots
We only want to check the status of physical replication slots to determine whether a streaming replication standby has become detached and there is therefore a risk of uncontrolled WAL buildup on the local node. It's not feasible to second-guess the state of logical replication slots.
This commit is contained in:
10
dbutils.c
10
dbutils.c
@@ -3982,7 +3982,8 @@ get_free_replication_slot_count(PGconn *conn)
|
||||
appendPQExpBufferStr(&query,
|
||||
" SELECT pg_catalog.current_setting('max_replication_slots')::INT - "
|
||||
" pg_catalog.count(*) AS free_slots"
|
||||
" FROM pg_catalog.pg_replication_slots");
|
||||
" FROM pg_catalog.pg_replication_slots s"
|
||||
" WHERE s.slot_type = 'physical'");
|
||||
|
||||
res = PQexec(conn, query.data);
|
||||
|
||||
@@ -4022,6 +4023,7 @@ get_inactive_replication_slots(PGconn *conn, KeyValueList *list)
|
||||
" SELECT slot_name, slot_type "
|
||||
" FROM pg_catalog.pg_replication_slots "
|
||||
" WHERE active IS FALSE "
|
||||
" AND slot_type = 'physical' "
|
||||
" ORDER BY slot_name ");
|
||||
|
||||
res = PQexec(conn, query.data);
|
||||
@@ -4952,9 +4954,9 @@ get_node_replication_stats(PGconn *conn, t_node_info *node_info)
|
||||
{
|
||||
appendPQExpBufferStr(&query,
|
||||
" current_setting('max_replication_slots')::INT AS max_replication_slots, "
|
||||
" (SELECT pg_catalog.count(*) FROM pg_catalog.pg_replication_slots) AS total_replication_slots, "
|
||||
" (SELECT pg_catalog.count(*) FROM pg_catalog.pg_replication_slots WHERE active IS TRUE) AS active_replication_slots, "
|
||||
" (SELECT pg_catalog.count(*) FROM pg_catalog.pg_replication_slots WHERE active IS FALSE) AS inactive_replication_slots, ");
|
||||
" (SELECT pg_catalog.count(*) FROM pg_catalog.pg_replication_slots WHERE slot_type='physical') AS total_replication_slots, "
|
||||
" (SELECT pg_catalog.count(*) FROM pg_catalog.pg_replication_slots WHERE active IS TRUE AND slot_type='physical') AS active_replication_slots, "
|
||||
" (SELECT pg_catalog.count(*) FROM pg_catalog.pg_replication_slots WHERE active IS FALSE AND slot_type='physical') AS inactive_replication_slots, ");
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user