show-subscriptions v5

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]

Examples

  Example 1 (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


  Example 2 (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


  Example 3 (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


  Example 4 (cluster with witness, logical standby and subscriber-only nodes;
  upstream for logical-standby-a1 is bdr-a1 and for logical-standby-b1 it is bdr-b1)
  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

Options

  -h, --help   help for show-subscriptions

Options inherited from parent commands

  -f, --config-file string   config file; ignored if 
                             --dsn flag is present (default "/etc/edb/pgd-cli/pgd-cli-config.yml")
      --dsn string           database connection string
                             e.g."host=bdr-a1 port=5432 dbname=bdrdb user=postgres "
  -L, --log-level string     logging level: debug, info, warn, error (default "error")
  -o, --output string        output format: json, yaml