Replication slots created by PGD v6.0.2

In previous versions of PGD, replication slots had human-readable names. PGD 6 has switched over to using UUIDs for nodes and groups to ensure better identification.

Replication slots are used by PostgreSQL to track the progress of replication. They're used to ensure that the data being replicated isn't lost and that the replication process is consistent. In PGD, replication slots are used to track the progress of replication from that node. There is one slot per downstream node. There's also a special replication slot used for tracking replication progress from a given node globally across all downstream nodes:

  • One group slot, named bdr_<topgroupuuid>_<dbhash>
  • N-1 node slots named bdr_node_<targetnodeuuid>_<dbhash>, where N is the total number of nodes in the cluster, including direct logical standbys, if any

Where topgroupuuid is the string representation of the top level-group's UUID (less the - characters) and dbhash is a hash of the database name. You can obtain the UUID of the top-level group using:

select node_group_uuid from bdr.node_group where node_group_parent_id=0;

And dbhash is a hash of the database name. You can obtain the hash using:

select to_hex(hashtext('pgddb'));

And the targetnodeuuid is the string representation of the target node's UUID (less the - characters). You can obtain the UUID of the target node using:

select node_uuid from bdr.node where node_name='<target_node_name>';

The complete group slot name is returned by the function bdr.local_group_slot_name().

Warning

Don't drop those slots. PGD creates and manages them and drops them when or if necessary.

  • Avoid touching slots prefixed with bdr_ slots directly.
  • Don't start slot names with the prefix bdr_.

Group slot

The group slot is used to track the progress of replication of the nodes in a PGD cluster that are replicating from the node. Each node in a PGD cluster has its own group slot, which is used to track the progress of replication from that node.

The group slot is used to:

  • Join new nodes to the PGD group without having all existing nodes up and running (although the majority of nodes should be up). This process doesn't incur data loss in case the node that was down during join starts replicating again.
  • Part nodes from the cluster consistently, even if some nodes haven't caught up fully with the parted node.
  • Hold back the freeze point to avoid missing some conflicts.
  • Keep the historical snapshot for timestamp-based snapshots.

The group slot is usually inactive and is fast forwarded only periodically in response to Raft progress messages from other nodes.

Warning

Don't drop the group slot. Although usually inactive, it's still vital to the proper operation of the EDB Postgres Distributed cluster. If you drop it, then some or all of PGD's features can stop working or have incorrect outcomes.

Other slot names

Other functionality within PGD makes use of replication slots.

For example, when a node is added to a group, a slot is created for that node to track its progress in the replication process.

This slot is named bdr_node_<targetnodeuuid>_<dbhash>_tmp.

There are also slots created for the analytics and decoding features of PGD. These slots have the following names.

Slot typeSlot name
Forwarding slot, leader-to-leader slotbdr_node_<targetnodeuuid>_<originidhex>_<dbhash>
Analytics slotbdr_analytics_<groupuuid>_<dbhash>
Decoding slotbdr_decoder_<topgroupuuid>_<dbhash>