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

ERROR: data stream ended #313

Open japinli opened 3 years ago

japinli commented 3 years ago

Recently, I encounter an error abort "data stream ended", I inspect the code and find it happens here.

Here is the error message:

2021-04-29 11:41:56.955 CST,,"xxxxxdb01",183809,,608a2b04.2ce01,1,"",2021-04-29 11:41:56 CST,33/0,0,LOG,00000,"starting apply for subscription south89reportdb01",,,,,,,,,"pglogical apply 16387:4088059939"
2021-04-29 11:41:57.729 CST,,"xxxxxdb01",183809,,608a2b04.2ce01,2,"",2021-04-29 11:41:56 CST,33/0,0,ERROR,XX000,"data stream ended",,,,,,,,,"pglogical apply 16387:4088059939"
2021-04-29 11:41:57.729 CST,,"xxxxxdb01",183809,,608a2b04.2ce01,3,"",2021-04-29 11:41:56 CST,33/0,0,LOG,00000,"apply worker [183809] at slot 1 generation 915 exiting with error",,,,,,,,,"pglogical apply 16387:4088059939"
2021-04-29 11:41:57.730 CST,,,48250,,5fca5633.bc7a,980,,2020-12-04 23:30:59 CST,,0,LOG,00000,"worker process: pglogical apply 16387:4088059939 (PID 183809) exited with exit code 1",,,,,,,,,""

The error code XX000 in PostgreSQL means this is for "can't-happen" conditions and software bugs.

For now, when we create a subscription using pglogical.create_subscription(), there is no errors, however the status is down, and there pglogical apply process doesn't exist.

How can I dig this problem?

PostgreSQl 10.3 & pglogical 2.2.1

krast-napoli commented 2 years ago

Hello! I had the same case. My steps to solve this problem

  1. Drop subscription.
  2. Drop all tables from replication_set (on host-provider)
  3. Recreate my subscription
  4. Add all tables that I need to replication_set again