13.3. bdr.bdr_node_slots

The bdr.bdr_node_slots view provides a convenient way to see which replication slots map to which nodes on a machine, as well as the current activity of those replication slots.

It is a convenience join on bdr.bdr_nodes, pg_catalog.pg_stat_replication and bdr.pg_replication_slots, showing which nodes have which slots, their current walsender activity and their replay positions.

The columns are all the same as the corresponding columns in the originating tables. An example listing might look like:

 node_name |                slot_name                | slot_restart_lsn | slot_confirmed_lsn | walsender_active | walsender_pid | sent_location | write_location | flush_location | replay_location 
 nodeA     | bdr_16385_6313760193895071967_1_16385__ | 0/1A7E680        | 0/1A7E6B8          | t                |         12359 | 0/1A7E6B8     | 0/1A7E6B8      | 0/1A7E6B8      | 0/1A7E6B8
 nodeC     | bdr_16385_6313760468754622756_1_16385__ | 0/1A7E680        | 0/1A7E6B8          | t                |         12360 | 0/1A7E6B8     | 0/1A7E6B8      | 0/1A7E6B8      | 0/1A7E6B8
(2 rows)

Note that slot_restart_lsn and slot_confirmed_lsn are the restart_lsn and confirmed_flush_lsn properties from pg_replication_slots. The other lsn properties are from pg_stat_replication and, along with the walsender_pid, will be null if there's no currently active replication connection for this slot.

If you want more detail from any of the joined tables, either modify the underlying query obtained with SELECT pg_get_viewdef('bdr.bdr_node_slots') or (preferably) join on the table(s) of interest to add more columns, using the node name, slot name, or pid as the key as appropriate.

For more on the use of this view, see Monitoring.