Logical replication dead but synching

Поиск
Список
Период
Сортировка
Искать

Logical replication dead but synching

От:
Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
Дата:
Hello,

While giving assistance to some customer with their broker procedure, I found a
scenario where the subscription is failing but the table are sync'ed anyway.
Here is bash script to reproduce it with versions 10, 11 and 12 (make sure
to set PATH correctly):

  # env
  PUB=/tmp/pub
  SUB=/tmp/sub
  unset PGPORT PGHOST PGDATABASE PGDATA
  export PGUSER=postgres

  # cleanup
  kill %1
  pg_ctl -w -s -D "$PUB" -m immediate stop; echo $?
  pg_ctl -w -s -D "$SUB" -m immediate stop; echo $?
  rm -r "$PUB" "$SUB"

  # cluster
  initdb -U postgres -N "$PUB" &>/dev/null; echo $?
  initdb -U postgres -N "$SUB" &>/dev/null; echo $?
  echo "wal_level=logical" >> "$PUB"/postgresql.conf
  echo "port=5433" >> "$SUB"/postgresql.conf
  pg_ctl -w -s -D $PUB -l "$PUB"-"$(date +%FT%T)".log start; echo $?
  pg_ctl -w -s -D $SUB -l "$SUB"-"$(date +%FT%T)".log start; echo $?
  pgbench -p 5432 -qi 
  pg_dump -p 5432 -s | psql -qXp 5433

  # fake activity
  pgbench -p 5432 -T 60 -c 2 &

  # replication setup
  cat<
FAQ