eulerto / wal2json

JSON output plugin for changeset extraction
BSD 3-Clause "New" or "Revised" License
1.3k stars 162 forks source link

ERROR: could not start WAL streaming: ERROR: option "proto_version" = "1" is unknown #244

Closed IT-Jiang closed 2 years ago

IT-Jiang commented 2 years ago

hi, I use wal2json to do the Postgres logical replication, ERROR: could not start WAL streaming: ERROR: option "proto_version" = "1" is unknown

can anyone help me? thanks

root@DESKTOP:/var/log/postgresql# psql --version
psql (PostgreSQL) 12.10 (Ubuntu 12.10-0ubuntu0.20.04.1)
root@DESKTOP:/var/log/postgresql#

publisher:

testdb=> SELECT * FROM pg_replication_slots\gx
-[ RECORD 1 ]-------+-------------------------------------------
slot_name           | sub1
**plugin              | wal2json**
slot_type           | logical
datoid              | 16471
database            | testdb
temporary           | f
active              | f
active_pid          |
xmin                |
catalog_xmin        | 37921
restart_lsn         | E/59000110
confirmed_flush_lsn | E/59000148

subscriber:

postgres=# select * from pg_subscription\gx
-[ RECORD 1 ]---+-------------
oid             | 16418
subdbid         | 13427
subname         | sub1
subowner        | 10
subenabled      | t
subconninfo     | host=xxx port=xxx dbname=testdb user=repl password=xxxx
subslotname     | sub1
subsynccommit   | off
subpublications | {xxx_publication}

postgres=#
2022-05-26 15:29:48.416 CST [9759] LOG:  logical replication apply worker for subscription "sub1" has started
2022-05-26 15:29:49.361 CST [9759] ERROR:  could not start WAL streaming: ERROR:  option "proto_version" = "1" is unknown
        CONTEXT:  slot "sub1", output plugin "wal2json", in the startup callback
2022-05-26 15:29:49.366 CST [9714] LOG:  background worker "logical replication worker" (PID 9759) exited with exit code 1
IT-Jiang commented 2 years ago

after change plugin wal2json to pgoutput is OK

eulerto commented 2 years ago

The only output plugin that the in-core logical replication accepts is pgoutput. What's your goal with such setup?

IT-Jiang commented 2 years ago

I use IBM Cloud® Databases for PostgreSQL deployments to logical replication. and it show me that The plug-in type must be wal2json.

https://cloud.ibm.com/docs/databases-for-postgresql?topic=databases-for-postgresql-wal2json

eulerto commented 2 years ago

As I said you cannot use wal2json for in-core logical replication. However, you can use it for another solutions such as CDC.