2ndQuadrant / pglogical

Logical Replication extension for PostgreSQL 17, 16, 15, 14, 13, 12, 11, 10, 9.6, 9.5, 9.4 (Postgres), providing much faster replication than Slony, Bucardo or Londiste, as well as cross-version upgrades.
http://2ndquadrant.com/en/resources/pglogical/
Other
1.01k stars 153 forks source link

pglogical_create_subscriber: Race Condition between subscriber promotion and remove_unwanted_data() #21

Closed moench-tegeder closed 8 years ago

moench-tegeder commented 8 years ago

pglogical_create_subscriber lets the newly created node catch up to the origin node via streaming replication - and waits for the new node to become ready via wait_postmaster_connection(). As recovery.conf (as written by pglogical_create_subscriber) has "standby_mode = on" and the postgresql.conf may have "hot_standby = on", just waiting for a connection is not enough: we already get a connection to the cluster while it's in hot standby mode. remove_unwanted_data() then fails spectacularly ("cannot DROP EXTENSION in a read only transaction"). We should wait for the end-of-recovery-promotion to complete.

moench-tegeder commented 8 years ago

closed via #22