You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have source and destination databases having versions 9.4 and 15.10 correspondingly. The source has pglogical 2.4.1 installed, the destination has pglogical 2.4.5. The source database is about 2Tb and has about 300 tables. When I create a subscription in the destination database pglogical creates a logical replication in the source databases successfully and the slot is active. But just when data synchronization is started, the slot becomes inactive which (I suppose) leads to a situation when no data changes are copied from source to destination when initial sync is done. I end up with the destination database with data actual on sync start and the source database which still has inactive replication slot (the full sync takes about 3 days). Despite the fact the replication slot is inactive data is still copied which looks strange to me.
I enabled log level = debug1 both on source and destination and I see nothing suspicious.
The source db logs:
Dec 15 15:13:30 dbs01 postgres[7987]: [66-1] < 2024-12-15 15:13:30.246 GMT > < 102/0 >DEBUG: received replication command: CREATE_REPLICATION_SLOT "pgl_DBNAME_dbs01_prod_DBNAME_prod" LOGICAL pglogical_output
Dec 15 15:13:30 dbs01 postgres[7987]: [67-1] < 2024-12-15 15:13:30.266 GMT > < 102/0 >DEBUG: searching for logical decoding starting point, starting at 3DA0/632286E0
Dec 15 15:13:30 dbs01 postgres[7987]: [68-1] < 2024-12-15 15:13:30.270 GMT > < 102/0 >LOG: logical decoding found initial starting point at 3DA0/632286E0
Dec 15 15:13:30 dbs01 postgres[7987]: [68-2] < 2024-12-15 15:13:30.270 GMT > < 102/0 >DETAIL: Waiting for transactions (approximately 1) older than 965107985 to end.
Dec 15 15:15:26 dbs01 postgres[7987]: [69-1] < 2024-12-15 15:15:26.591 GMT > < 102/0 >LOG: logical decoding found initial consistent point at 3DA0/63E56E08
Dec 15 15:15:26 dbs01 postgres[7987]: [69-2] < 2024-12-15 15:15:26.591 GMT > < 102/0 >DETAIL: Waiting for transactions (approximately 2) older than 965108322 to end.
Dec 15 15:15:52 dbs01 postgres[7987]: [70-1] < 2024-12-15 15:15:52.031 GMT > < 102/0 >LOG: logical decoding found consistent point at 3DA0/64007DD0
Dec 15 15:15:52 dbs01 postgres[7987]: [70-2] < 2024-12-15 15:15:52.031 GMT > < 102/0 >DETAIL: There are no old transactions anymore.
Dec 15 15:15:52 dbs01 postgres[7987]: [71-1] < 2024-12-15 15:15:52.032 GMT > < 102/23793332 >LOG: exported logical decoding snapshot: "398662A6-1" with 2 transaction IDs
Please, don't care the timestamps. I copied the result from two different attempts because I increased log level in the destination database later then in the source one.
Info about the replication slot:
ru_loans=# select * from pg_replication_slots where slot_name = '<slot_name>';
-[ RECORD 1 ]+-------------------------------------------
slot_name | <slot_name>
plugin | pglogical_output
slot_type | logical
datoid | 2480954
database | DBNAME
active | f
xmin |
catalog_xmin | 965109778
restart_lsn | 3DA0/67867B18
The important detail is that I used the same method to copy the database of exact same size on another cluster and everything was fine. Small databases in the cluster in question are also copied well.
I was thinking that was a network issue so tuned some parameters related to TCP in sysctl and used IP address instead of hostname in create_subscription function but it didn't help.
I appreciate any help. Thank you!
The text was updated successfully, but these errors were encountered:
It turned out that it's a normal situation. The replication slot is inactive during initial data sync. It becomes active as soon as pglogical competes copying data and starts reading changes from the slot. It looks like there was a network issue during my first attempt so it didn't update data.
I have source and destination databases having versions 9.4 and 15.10 correspondingly. The source has pglogical 2.4.1 installed, the destination has pglogical 2.4.5. The source database is about 2Tb and has about 300 tables. When I create a subscription in the destination database pglogical creates a logical replication in the source databases successfully and the slot is active. But just when data synchronization is started, the slot becomes inactive which (I suppose) leads to a situation when no data changes are copied from source to destination when initial sync is done. I end up with the destination database with data actual on sync start and the source database which still has inactive replication slot (the full sync takes about 3 days). Despite the fact the replication slot is inactive data is still copied which looks strange to me.
I enabled log level = debug1 both on source and destination and I see nothing suspicious.
The source db logs:
The destination db logs:
Please, don't care the timestamps. I copied the result from two different attempts because I increased log level in the destination database later then in the source one.
Info about the replication slot:
pg_stat_replication:
The important detail is that I used the same method to copy the database of exact same size on another cluster and everything was fine. Small databases in the cluster in question are also copied well.
I was thinking that was a network issue so tuned some parameters related to TCP in sysctl and used IP address instead of hostname in create_subscription function but it didn't help.
I appreciate any help. Thank you!
The text was updated successfully, but these errors were encountered: