-
-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to set up replication #332
Comments
Hi @deathemperor, From the first log sample, it looks like the replica is receiving replication events from Postgres, but then it can't send its response. Is there anything in the postgres log to indicate what's happening? We haven't seen this failure mode in any of our testing. What version of Postgres are you running? And what does the https://www.postgresql.org/docs/16/view-pg-replication-slots.html We haven't tried running our replica tests on Mac yet, only Ubuntu. We'll see if we can reproduce that. Also happy to help you debug this in real time on our discord, come on by whenever you have a chance. |
hey @zachmu, More details as requested: Postgres log2024-06-04 01:57:19.326 UTC [3147] STATEMENT: START_REPLICATION SLOT doltgres_slot_test LOGICAL 0/1 (proto_version '2', publication_names 'doltgres_slot_test', messages 'true', streaming 'true') 2024-06-04 01:57:21.869 UTC [3151] LOG: starting logical decoding for slot "doltgres_slot_test" 2024-06-04 01:57:21.869 UTC [3151] DETAIL: Streaming transactions committing after 0/1, reading WAL from 4/C6201FD8. 2024-06-04 01:57:21.869 UTC [3151] STATEMENT: START_REPLICATION SLOT doltgres_slot_test LOGICAL 0/1 (proto_version '2', publication_names 'doltgres_slot_test', messages 'true', streaming 'true') 2024-06-04 01:57:21.869 UTC [3151] LOG: logical decoding found consistent point at 4/C6201FD8 2024-06-04 01:57:21.869 UTC [3151] DETAIL: There are no running transactions. 2024-06-04 01:57:21.869 UTC [3151] STATEMENT: START_REPLICATION SLOT doltgres_slot_test LOGICAL 0/1 (proto_version '2', publication_names 'doltgres_slot_test', messages 'true', streaming 'true') 2024-06-04 01:57:31.868 UTC [3153] LOG: starting logical decoding for slot "doltgres_slot_test" 2024-06-04 01:57:31.868 UTC [3153] DETAIL: Streaming transactions committing after 0/1, reading WAL from 4/C6201FD8. 2024-06-04 01:57:31.868 UTC [3153] STATEMENT: START_REPLICATION SLOT doltgres_slot_test LOGICAL 0/1 (proto_version '2', publication_names 'doltgres_slot_test', messages 'true', streaming 'true') 2024-06-04 01:57:31.868 UTC [3153] LOG: logical decoding found consistent point at 4/C6201FD8 2024-06-04 01:57:31.868 UTC [3153] DETAIL: There are no running transactions. 2024-06-04 01:57:31.868 UTC [3153] STATEMENT: START_REPLICATION SLOT doltgres_slot_test LOGICAL 0/1 (proto_version '2', publication_names 'doltgres_slot_test', messages 'true', streaming 'true') 2024-06-04 01:57:41.876 UTC [3156] LOG: starting logical decoding for slot "doltgres_slot_test" 2024-06-04 01:57:41.876 UTC [3156] DETAIL: Streaming transactions committing after 0/1, reading WAL from 4/C6201FD8. 2024-06-04 01:57:41.876 UTC [3156] STATEMENT: START_REPLICATION SLOT doltgres_slot_test LOGICAL 0/1 (proto_version '2', publication_names 'doltgres_slot_test', messages 'true', streaming 'true') 2024-06-04 01:57:41.876 UTC [3156] LOG: logical decoding found consistent point at 4/C6201FD8 2024-06-04 01:57:41.876 UTC [3156] DETAIL: There are no running transactions. 2024-06-04 01:57:41.876 UTC [3156] STATEMENT: START_REPLICATION SLOT doltgres_slot_test LOGICAL 0/1 (proto_version '2', publication_names 'doltgres_slot_test', messages 'true', streaming 'true') 2024-06-04 01:57:51.884 UTC [3165] LOG: starting logical decoding for slot "doltgres_slot_test" 2024-06-04 01:57:51.884 UTC [3165] DETAIL: Streaming transactions committing after 0/1, reading WAL from 4/C6201FD8. 2024-06-04 01:57:51.884 UTC [3165] STATEMENT: START_REPLICATION SLOT doltgres_slot_test LOGICAL 0/1 (proto_version '2', publication_names 'doltgres_slot_test', messages 'true', streaming 'true') 2024-06-04 01:57:51.884 UTC [3165] LOG: logical decoding found consistent point at 4/C6201FD8 2024-06-04 01:57:51.884 UTC [3165] DETAIL: There are no running transactions. 2024-06-04 01:57:51.884 UTC [3165] STATEMENT: START_REPLICATION SLOT doltgres_slot_test LOGICAL 0/1 (proto_version '2', publication_names 'doltgres_slot_test', messages 'true', streaming 'true') 2024-06-04 01:57:56.899 UTC [3167] FATAL: role "root" does not exist 2024-06-04 01:58:03.732 UTC [3171] FATAL: role "root" does not exist 2024-06-04 01:58:11.892 UTC [3175] LOG: starting logical decoding for slot "doltgres_slot_test" 2024-06-04 01:58:11.892 UTC [3175] DETAIL: Streaming transactions committing after 0/1, reading WAL from 4/C6201FD8. 2024-06-04 01:58:11.892 UTC [3175] STATEMENT: START_REPLICATION SLOT doltgres_slot_test LOGICAL 0/1 (proto_version '2', publication_names 'doltgres_slot_test', messages 'true', streaming 'true') 2024-06-04 01:58:11.892 UTC [3175] LOG: logical decoding found consistent point at 4/C6201FD8 2024-06-04 01:58:11.892 UTC [3175] DETAIL: There are no running transactions. 2024-06-04 01:58:11.892 UTC [3175] STATEMENT: START_REPLICATION SLOT doltgres_slot_test LOGICAL 0/1 (proto_version '2', publication_names 'doltgres_slot_test', messages 'true', streaming 'true') 2024-06-04 01:58:31.900 UTC [3179] LOG: starting logical decoding for slot "doltgres_slot_test" 2024-06-04 01:58:31.900 UTC [3179] DETAIL: Streaming transactions committing after 0/1, reading WAL from 4/C6201FD8. 2024-06-04 01:58:31.900 UTC [3179] STATEMENT: START_REPLICATION SLOT doltgres_slot_test LOGICAL 0/1 (proto_version '2', publication_names 'doltgres_slot_test', messages 'true', streaming 'true') 2024-06-04 01:58:31.900 UTC [3179] LOG: logical decoding found consistent point at 4/C6201FD8 2024-06-04 01:58:31.900 UTC [3179] DETAIL: There are no running transactions. 2024-06-04 01:58:31.900 UTC [3179] STATEMENT: START_REPLICATION SLOT doltgres_slot_test LOGICAL 0/1 (proto_version '2', publication_names 'doltgres_slot_test', messages 'true', streaming 'true') 2024-06-04 01:58:41.907 UTC [3182] LOG: starting logical decoding for slot "doltgres_slot_test" 2024-06-04 01:58:41.907 UTC [3182] DETAIL: Streaming transactions committing after 0/1, reading WAL from 4/C6201FD8. 2024-06-04 01:58:41.907 UTC [3182] STATEMENT: START_REPLICATION SLOT doltgres_slot_test LOGICAL 0/1 (proto_version '2', publication_names 'doltgres_slot_test', messages 'true', streaming 'true') 2024-06-04 01:58:41.907 UTC [3182] LOG: logical decoding found consistent point at 4/C6201FD8 2024-06-04 01:58:41.907 UTC [3182] DETAIL: There are no running transactions. 2024-06-04 01:58:41.907 UTC [3182] STATEMENT: START_REPLICATION SLOT doltgres_slot_test LOGICAL 0/1 (proto_version '2', publication_names 'doltgres_slot_test', messages 'true', streaming 'true') 2024-06-04 01:58:51.913 UTC [3184] LOG: starting logical decoding for slot "doltgres_slot_test" 2024-06-04 01:58:51.913 UTC [3184] DETAIL: Streaming transactions committing after 0/1, reading WAL from 4/C6201FD8. 2024-06-04 01:58:51.913 UTC [3184] STATEMENT: START_REPLICATION SLOT doltgres_slot_test LOGICAL 0/1 (proto_version '2', publication_names 'doltgres_slot_test', messages 'true', streaming 'true') 2024-06-04 01:58:51.913 UTC [3184] LOG: logical decoding found consistent point at 4/C6201FD8 2024-06-04 01:58:51.913 UTC [3184] DETAIL: There are no running transactions. 2024-06-04 01:58:51.913 UTC [3184] STATEMENT: START_REPLICATION SLOT doltgres_slot_test LOGICAL 0/1 (proto_version '2', publication_names 'doltgres_slot_test', messages 'true', streaming 'true') 2024-06-04 01:59:01.920 UTC [3187] LOG: starting logical decoding for slot "doltgres_slot_test" 2024-06-04 01:59:01.920 UTC [3187] DETAIL: Streaming transactions committing after 0/1, reading WAL from 4/C6201FD8. 2024-06-04 01:59:01.920 UTC [3187] STATEMENT: START_REPLICATION SLOT doltgres_slot_test LOGICAL 0/1 (proto_version '2', publication_names 'doltgres_slot_test', messages 'true', streaming 'true') 2024-06-04 01:59:01.921 UTC [3187] LOG: logical decoding found consistent point at 4/C6201FD8 2024-06-04 01:59:01.921 UTC [3187] DETAIL: There are no running transactions. 2024-06-04 01:59:01.921 UTC [3187] STATEMENT: START_REPLICATION SLOT doltgres_slot_test LOGICAL 0/1 (proto_version '2', publication_names 'doltgres_slot_test', messages 'true', streaming 'true') 2024-06-04 01:59:11.927 UTC [3189] LOG: starting logical decoding for slot "doltgres_slot_test" 2024-06-04 01:59:11.927 UTC [3189] DETAIL: Streaming transactions committing after 0/1, reading WAL from 4/C6201FD8. 2024-06-04 01:59:11.927 UTC [3189] STATEMENT: START_REPLICATION SLOT doltgres_slot_test LOGICAL 0/1 (proto_version '2', publication_names 'doltgres_slot_test', messages 'true', streaming 'true') 2024-06-04 01:59:11.927 UTC [3189] LOG: logical decoding found consistent point at 4/C6201FD8 2024-06-04 01:59:11.927 UTC [3189] DETAIL: There are no running transactions. 2024-06-04 01:59:11.927 UTC [3189] STATEMENT: START_REPLICATION SLOT doltgres_slot_test LOGICAL 0/1 (proto_version '2', publication_names 'doltgres_slot_test', messages 'true', streaming 'true')Postgres version: result of postgres=# SELECT * FROM pg_stat_replication;
pid | usesysid | usename | application_name | client_addr | client_hostname | client_port | backend_start | backend_xmin | state | sent_lsn | write_lsn | flush_lsn | replay_lsn | write_lag | flush_lag | replay_lag | sync_priority | sync_state | reply_time
------+----------+----------+------------------+-------------+-----------------+-------------+-------------------------------+--------------+-----------+------------+-----------+-----------+------------+-----------+-----------+------------+---------------+------------+-------------------------------
3179 | 10 | postgres | | 172.23.0.1 | | 56616 | 2024-06-04 01:58:31.897029+00 | | streaming | 4/C6202450 | 0/1 | 0/1 | 4/C6202451 | | | | 0 | async | 2024-06-04 01:58:31.900897+00 |
Nothing here looks super suspicious to me. I think what we'll try here is making sending the standby messages more resilient, so replication doesn't die or restart when it can't send the standby messages. We'll have that out for you to try in a couple days. |
@zachmu any update? |
I was able to set up and got it running on my machine but the same error still occurs on my development server. doltgres logINFO[0000] Server ready. Accepting connections. specifically the config.yaml listener:
host: 127.0.0.1
port: 5455
postgres_replication:
postgres_server_address: localhost
postgres_user: postgres
postgres_password: 123456
postgres_database: postgres
postgres_port: 5436
slot_name: doltgres_slot_test
behavior:
dolt_transaction_commit: true
read_only: false
log_level: debug |
I've tried with 2 types of OS without success, each with its own problem. Both are doltgres 0.7.5
Ubuntu 20.04:
config.yaml:
log of running
doltgres --data-dir /vol2/dolgresql/data
I followed replication instruction here: https://docs.doltgres.com/guides/replication-from-postgres. Trying to test with
employees
table=================================
MacOS M3 Max version 14.5
config.yaml:
logs of running
doltgres -config config.yaml
It's supposed to throw error because the
postgres_server_address
and its info is incorrect, as well as slot name. In Ubuntu it's able to throw connection error if doltgres has trouble connecting. I set the config to incorrect info for troubleshooting after running the cli but no similar logs output found comparing to the ubuntu's.The text was updated successfully, but these errors were encountered: