show-subscriptions v5.6
Shows BDR subscription (incoming replication) details.
Synopsis
Shows BDR subscription (incoming replication) details such as origin/target node, timestamp of the last replayed transaction, and lag between now and the timestamp of the last replayed transaction.
pgd show-subscriptions [flags]
Options
No specific command options. See global options for global options.
Examples
Show subscriptions with a node down
In this example, there is a 3 node cluster, bdr-a1 and bdr-c1 are up, bdr-b1 is down.
$ pgd show-subscriptions
Origin Node Target Node Last Transaction Replayed At Lag Duration (seconds) ----------- ----------- ---------------------------- ---------------------- bdr-a1 bdr-c1 2022-04-23 13:13:40.854433+00 0.514275 bdr-b1 bdr-a1 bdr-b1 bdr-c1 bdr-c1 bdr-a1 2022-04-23 13:13:40.852233+00 0.335464
Show subscriptions with a recently restarted node
In this example, there is a 3 node cluster, bdr-b1 was down and it has just been restarted.
$ pgd show-subscriptions
Origin Node Target Node Last Transaction Replayed At Lag Duration (seconds) ----------- ----------- ---------------------------- ---------------------- bdr-a1 bdr-b1 2022-04-23 13:14:45.669254+00 0.001686 bdr-a1 bdr-c1 2022-04-23 13:14:46.157913+00 -0.002009 bdr-b1 bdr-a1 bdr-b1 bdr-c1 bdr-c1 bdr-a1 2022-04-23 13:14:45.698472+00 0.259521 bdr-c1 bdr-b1 2022-04-23 13:14:45.667979+00 0.002961
Show subscriptions with all nodes working correctly
In this example, there is a 3 node cluster, all nodes are up and in 'streaming' state.
$ pgd show-subscriptions
Origin Node Target Node Last Transaction Replayed At Lag Duration (seconds) ----------- ----------- ---------------------------- ---------------------- bdr-a1 bdr-b1 2022-04-23 13:15:39.732375+00 0.034462 bdr-a1 bdr-c1 2022-04-23 13:15:40.179618+00 0.002647 bdr-b1 bdr-a1 2022-04-23 13:15:39.719994+00 0.305814 bdr-b1 bdr-c1 2022-04-23 13:15:40.180886+00 0.001379 bdr-c1 bdr-a1 2022-04-23 13:15:39.714397+00 0.311411 bdr-c1 bdr-b1 2022-04-23 13:15:39.714397+00 0.052440
Show subscriptions in a multi-node cluster
In this example, there is a 4 node cluster. bdr-a1 and bdr-b1 are the origin nodes for logical-standby-a1 and logical-standby-b1 respectively. bdr-a1 and bdr-b1 are the origin nodes for subscriber-only-c1. bdr-a1 and bdr-b1 are the origin nodes for witness-c1.
Note: Logical standby and subscriber-only nodes receive changes but do not send changes made locally to other nodes
$ pgd show-subscriptions
Origin Node Target Node Last Transaction Replayed At Lag Duration (seconds) ----------- ----------- ---------------------------- ---------------------- bdr-a1 bdr-b1 2022-04-23 13:40:49.106411+00 0.853665 bdr-a1 logical-standby-a1 2022-04-23 13:40:50.72036+00 0.138430 bdr-a1 logical-standby-b1 bdr-a1 subscriber-only-c1 2022-04-23 13:40:50.72036+00 0.016226 bdr-a1 witness-c1 2022-04-23 13:40:50.470142+00 0.001514 bdr-b1 bdr-a1 2022-04-23 13:40:49.10174+00 1.095422 bdr-b1 logical-standby-a1 bdr-b1 logical-standby-b1 2022-04-23 13:40:50.713666+00 0.271213 bdr-b1 subscriber-only-c1 2022-04-23 13:40:50.713666+00 0.022920 bdr-b1 witness-c1 2022-04-23 13:40:50.471789+00 -0.000133 witness-c1 bdr-a1 2022-04-23 13:40:49.107706+00 1.089456 witness-c1 bdr-b1 2022-04-23 13:40:49.107706+00 0.852370 witness-c1 logical-standby-a1 witness-c1 logical-standby-b1 witness-c1 subscriber-only-c1 2022-04-23 13:40:50.719844+00 0.016742