pglogical icon indicating copy to clipboard operation
pglogical copied to clipboard

Why do I get replication origin "pgl_____ngine_..." does not exist error when setup pglogical

Open zhaoyi0113 opened this issue 2 years ago • 1 comments

I have two postgresql 11.9 and 13.4.

The node, replica_set and subscription are all created successfully in both clusters. However, when I check the subscription status in the target database, the status is down:

=> select subscription_name, slot_name, status from pglogical.show_subscription_status();
 subscription_name |                   slot_name                   | status
-------------------+-----------------------------------------------+--------
 ams_subscription1 | pgl_____ngine_ams_mast2d01c59_ams_subsc050888 | down
(1 row)

In the target database log, I can see below error:


2022-03-01 06:34:29 UTC::@:[16329]:LOG: background worker "pglogical apply 16400:3226503298" (PID 29403) exited with exit code 1
2022-03-01 06:35:49 UTC::@:[16329]:LOG: background worker "pglogical apply 16400:3226503298" (PID 1453) exited with exit code 1
2022-03-01 06:38:29 UTC::@:[16329]:LOG: background worker "pglogical apply 16400:3226503298" (PID 10318) exited with exit code 1
----------------------- END OF LOG ----------------------

in the source database log:

2022-03-01 06:34:29 UTC:10.74.105.225(33688):amsMasterUser@AMSEngine:[26786]:ERROR: replication origin "pgl_____ngine_ams_mast2d01c59_ams_subsc050888" does not exist
2022-03-01 06:34:29 UTC:10.74.105.225(33688):amsMasterUser@AMSEngine:[26786]:STATEMENT: SELECT pg_catalog.pg_replication_origin_session_setup('pgl_____ngine_ams_mast2d01c59_ams_subsc050888');
BEGIN TRANSACTION ISOLATION LEVEL READ COMMITTED;
SET session_replication_role = 'replica';
SET DATESTYLE = ISO;
SET INTERVALSTYLE = POSTGRES;
SET extra_float_digits TO 3;
SET statement_timeout = 0;
SET lock_timeout = 0;

2022-03-01 06:34:29 UTC:10.74.105.225(33688):amsMasterUser@AMSEngine:[26786]:LOG: could not receive data from client: Connection reset by peer
2022-03-01 06:34:29 UTC:10.74.105.225(33684):amsMasterUser@AMSEngine:[26784]:LOG: could not receive data from client: Connection reset by peer
2022-03-01 06:34:29 UTC:10.74.105.225(33684):amsMasterUser@AMSEngine:[26784]:LOG: unexpected EOF on client connection with an open transaction
2022-03-01 06:34:29 UTC:10.74.105.225(33686):amsMasterUser@AMSEngine:[26785]:LOG: could not receive data from client: Connection reset by peer
2022-03-01 06:34:29 UTC:10.74.105.225(33686):amsMasterUser@AMSEngine:[26785]:LOG: unexpected EOF on client connection with an open transaction
----------------------- END OF LOG ----------------------

I can see there are errors in both source and target instances. But I can't figure out what could be the issue.

zhaoyi0113 avatar Mar 01 '22 07:03 zhaoyi0113

I faced the same issue in v16 and was able to fix it by using the below steps:

  • Error:
2024-05-08 01:34:09.581 UTC [26390] ERROR:  replication origin "pgl_logi_provider1_subscription1" does not exist
  1. Drop the subscription.
logi=# select pglogical.drop_subscription('subscription1');
 drop_subscription
-------------------
                 1
(1 row)
  1. Create a replication origin.
logi=# select pg_replication_origin_create('pgl_logi_provider1_subscription1');
 pg_replication_origin_create
------------------------------
                            1
(1 row)
  1. Recreate the subscription.
logi=# SELECT pglogical.create_subscription(subscription_name := 'subscription1',provider_dsn := 'host=10.x.x.x port=5432 dbname=logi user=pglogical password=xxxxx');
 create_subscription
---------------------
          1763399739
(1 row)

However, I am not sure why this error occurred when the same steps without manually creating a replication origin worked in v14.

glearn140 avatar May 08 '24 02:05 glearn140