Re: Logical Replication Delay

2024-09-29 Thread GF
Hi Ram, 29 set 2024, 12:29 Ramakrishna m : *We are planning to set up logical replication from a standby to another > server. When the primary goes down, there is no issue as the standby > becomes the primary and the logical slots are already present. However, > when the standby

Re: Logical Replication Delay

2024-09-29 Thread Ramakrishna m
up logical replication from a standby to another server. When the primary goes down, there is no issue as the standby becomes the primary and the logical slots are already present. However, when the standby goes down, these slots are not copied to the third node or the primary by Patroni. Is there

Re: MError after replication in postgresql

2024-09-25 Thread Muhammad Usman Khan
etting error after doing replication on posrgresql 16.3 (OS is HP > UX) > error is regarding Libpq library, we are unable to start sync getting error > > FATAL: could not connect to the primary server : libpq is incorrectly > linked to backend functions. > LOG: waiting for WAL to

Re: Logical Replication Delay

2024-09-25 Thread Greg Sabino Mullane
On Sat, Sep 21, 2024 at 3:08 PM Ramakrishna m wrote: > I would greatly appreciate any suggestions you may have to help avoid > logical replication delays, whether through tuning database or operating > system parameters, or any other recommendations > In addition to the things alre

Re: MError after replication in postgresql

2024-09-25 Thread Laurenz Albe
On Wed, 2024-09-25 at 10:57 +0530, Danish Hajwane wrote: > We are getting error after doing replication on posrgresql 16.3 (OS is HP UX) > error is regarding Libpq library, we are unable to start sync getting error > > FATAL: could not connect to the primary server : libpq is incorr

MError after replication in postgresql

2024-09-24 Thread Danish Hajwane
Hi Team, We are getting error after doing replication on posrgresql 16.3 (OS is HP UX) error is regarding Libpq library, we are unable to start sync getting error FATAL: could not connect to the primary server : libpq is incorrectly linked to backend functions. LOG: waiting for WAL to become

Re: Logical Replication Delay

2024-09-23 Thread Justin
Hi Ramakrishna, I am not following the reasoning on not separating the tables into different publications and subscriptions. I set up logical replication all the time in many different environments, one of the audits I perform before deploying LR is looking at pg_stat_all_tables and WAL creation

Re: Logical Replication Delay

2024-09-22 Thread Ramakrishna m
isher and subscriber has to do. > > Hope this helps. > > > > On Sat, Sep 21, 2024 at 3:08 PM Ramakrishna m wrote: > >> Hi Team, >> >> We have configured bidirectional replication (but traffic can only flow >> in one direction) between two data centers (dist

Re: Logical Replication Delay

2024-09-21 Thread Justin
bidirectional replication (but traffic can only flow in > one direction) between two data centers (distance: 1000 km, maximum Network > latency: 100 ms) with an application TPS (transactions per second) of 700 > at maximum. > > We are fine with handling up to 500 TPS without observing a

Logical Replication Delay

2024-09-21 Thread Ramakrishna m
Hi Team, We have configured bidirectional replication (but traffic can only flow in one direction) between two data centers (distance: 1000 km, maximum Network latency: 100 ms) with an application TPS (transactions per second) of 700 at maximum. We are fine with handling up to 500 TPS without

pglogical selective child replication between different partition interval tables

2024-09-12 Thread Durgamahesh Manne
replicate selective child table (changelog_event_p20240906) to target with logical replication or pglogical create publication with where clause does work in this scenario? Regards. Durga Mahesh

Re: Logical replication without direct link between publisher and subscriber?

2024-09-12 Thread Koen De Groote
I've considered it, but it sounds like a lot of work and failure prone. Even projects like Debezium seem like it's a ton to set up. Thanks for the suggestions. Regards, Koen On Wed, Sep 11, 2024 at 3:20 PM Greg Sabino Mullane wrote: > Dumping changes periodically, sending them directly or uplo

Re: Logical replication without direct link between publisher and subscriber?

2024-09-11 Thread Greg Sabino Mullane
> > Dumping changes periodically, sending them directly or uploading to cloud > storage and then downloading and applying them on the subscriber side. > But maybe there's a simpler option someone here knows about? How about using WAL shipping to populate a replica, and either query that directly

Logical replication without direct link between publisher and subscriber?

2024-09-09 Thread Koen De Groote
I want to have a PG instance receive logical replication from a publisher. However, the subscriber should not have network access to the publisher, in any way. This is for security reasons. No VPN or any setup that allows the subscriber to send traffic to the publisher host. The publisher

Re: Monitoring logical replication

2024-09-03 Thread Shaheed Haque
n the publication and >> subscription sides that should be used to track the delta between the two >> systems? I ask because Google is full of different pairs being used. I >> tried to identify the highest level interface points exposed, i.e. what is >> documented on >&g

Re: Postgres Logical Replication - how to see what subscriber is doing with received data?

2024-09-02 Thread Shaheed Haque
_work_mem on >>> subscriber (In case bottleneck exists on subscriber) >>> >>> If there's significant lag, consider whether it might be more efficient >>> to drop the subscription and re-initialize it from scratch using a new base >>> backup, depending

Re: Postgres Logical Replication - how to see what subscriber is doing with received data?

2024-09-02 Thread Muhammad Ikram
(In case bottleneck exists on subscriber) >> >> If there's significant lag, consider whether it might be more efficient >> to drop the subscription and re-initialize it from scratch using a new base >> backup, depending on the data volume and how long it might take for the >

Re: Postgres Logical Replication - how to see what subscriber is doing with received data?

2024-09-02 Thread Shaheed Haque
ubscription and re-initialize it from scratch using a new base > backup, depending on the data volume and how long it might take for the > existing replication to catch up. > Thanks for the kind hints, I'll certainly look into those. My main interest however was with the "visibi

Re: Postgres Logical Replication - how to see what subscriber is doing with received data?

2024-09-01 Thread Muhammad Ikram
subscriber (In case bottleneck exists on subscriber) If there's significant lag, consider whether it might be more efficient to drop the subscription and re-initialize it from scratch using a new base backup, depending on the data volume and how long it might take for the existing replicati

Could we go back in a replication slot?

2024-09-01 Thread xiong ding
Hi, community, The START_REPLICATION command accepts a lsn parameter, but according to the document that replication "starts at either WAL location XXX/XXX or the slot's confirmed_flush_lsn (see Section 54.19), whichever is greater." I wonder if there is a way to go back, like a

Re: Postgres Logical Replication - how to see what subscriber is doing with received data?

2024-09-01 Thread Shaheed Haque
artly on that thread, I ended up with a script that connects to both ends of the replication, and basically loops while comparing the counts in each table. On Fri, 30 Aug 2024, 12:38 Michael Jaskiewicz, wrote: > I've got two Postgres 13 databases on AWS RDS. > >- One is a master

Postgres Logical Replication - how to see what subscriber is doing with received data?

2024-08-30 Thread Michael Jaskiewicz
I've got two Postgres 13 databases on AWS RDS. * One is a master, the other a slave using logical replication. * Replication has fallen behind by about 350Gb. * The slave was maxed out in terms of CPU for the past four days because of some jobs that were ongoing so I'm not

logical replication - who is managing replication slots created automatically during initial sync

2024-08-26 Thread Avi Weinberg
Hi Experts I have seen that logical replication slots created automatically by Postgres during initial sync (a slot per table), are marked as "wal_status = lost" and "active = false". 1. Who is responsible for removing those faulty replication slots? 2. Can a s

Re: About replication minimal disk space usage

2024-08-24 Thread Tomas Vondra
On 8/24/24 14:18, Manan Kansara wrote: > Hello All, > I have my self hosted postgres server on aws with 16gb disk space > attached to it for ml stuff and analysis stuff we are using vertex ai so > i have setup live replication of postgres using data stream service to > BigQuery

About replication minimal disk space usage

2024-08-24 Thread Manan Kansara
Hello All, I have my self hosted postgres server on aws with 16gb disk space attached to it for ml stuff and analysis stuff we are using vertex ai so i have setup live replication of postgres using data stream service to BigQuery table. We use BigQuery table as data warehouse because we have so

Re: pg 16.4, logical replication, use case = data archiving

2024-08-19 Thread milist ujang
My experience with oracle streams (upto version 12.1). there is a tag at capture, by default tag is null (if not defined). at the session level we set DBMS_STREAMS.SET_TAG ; so whatever this session does, will not replicate. Maybe this kind of "tag" is planned in the upcoming logical r

pg 16.4, logical replication, use case = data archiving

2024-08-19 Thread milist ujang
Hi all, I Play logical replication with row filter feature, my use case is data archiving. in lab env, it worked, my questions: - during alter subscription, what about on-going DML? Can it be lost? - any lock during alter subscription should I aware? scenario: # on source tutorial=# ALTER

Re: WAL replication and Archive command for pgbackrest on same server conf

2024-08-19 Thread Ruben Morais
hi, you can combine: archive_command = 'pgbackrest --stanza=Demo archive-push %p && cp %p /data/archive/%f ' You need to change your standby replica to consume the wals from pgbackrest if you want instead to use both commands. *Rúben Morais* *(+351) 965775713*

WAL replication and Archive command for pgbackrest on same server conf

2024-08-19 Thread KK CHN
Hi List , I am trying to configure the pgbackrest on a live server ( RHEL9, EPAS16 and Pgbacrest .2.52) which is having a working WAL archive configuration to a standby server in postgresql.conf as follows 1. archive_mod =on 2. archive_level=replica 3. archive_command = 'cp %p /data/archive

Re: Streaming replication issue post upgrade from version 11 to 14 on windows 2016 Server

2024-08-06 Thread Muhammad Ikram
Hi Vamsi, We have been doing these steps to setup streaming replication --Primay-Server CREATE ROLE repl REPLICATION LOGIN PASSWORD 'your_password'; postgresql.conf listen_addresses = '*' wal_level = replica archive_mode = on archive_command = 'copy %p \\path_to_arc

Streaming replication issue post upgrade from version 11 to 14 on windows 2016 Server

2024-08-06 Thread Vamsi Chava
Hi Team, we have upgraded postgresql version 11 to 14 on windows server 2016, post upgrade we configured streaming replication. the data is not getting replicated. but compared to version 11, 14 is very different in configuring replication. Tried from documentation from postgres site. no luck

Re: Logical replication slots on slaves/replicas?

2024-08-01 Thread Piotr Andreassen Blasiak
am before it becomes visible on the master. In > particular, this is possible with a sync replication setup. So, I would not > trust to always be able to see the transaction on the master as soon as it is > reported committed in the wal stream. > > All the best, > Torsten > &g

Re: Logical replication slots on slaves/replicas?

2024-08-01 Thread Torsten Förtsch
anges made by the transaction. BTW, I am sure I can construct a situation where you see your transaction in the logical wal stream before it becomes visible on the master. In particular, this is possible with a sync replication setup. So, I would not trust to always be able to see the transaction o

Re: Logical replication slots on slaves/replicas?

2024-08-01 Thread shammat
Piotr Andreassen Blasiak schrieb am 01.08.2024 um 10:42: > I know that currently logical replication slots are available only > for primary servers. Is there any plan to add this feature to read > slaves as well? My problem is this: > > I want to use debezium to stream changes from

Logical replication slots on slaves/replicas?

2024-08-01 Thread Piotr Andreassen Blasiak
Hi, I know that currently logical replication slots are available only for primary servers. Is there any plan to add this feature to read slaves as well? My problem is this: I want to use debezium to stream changes from postgresql. But, if I stream changes from the master I can not query my

Re: Replication lag in Postgres

2024-07-13 Thread Muhammad Imtiaz
will helpful if there is a delay in streaming replication, you have a backup of WAL files. Regards, Muhammad Imtiaz On Fri, 12 Jul 2024, 20:11 Mukesh Tanuku, wrote: > Hello everyone. > Firstly thanks to the community members who are addressing all the queries > that are posted. Those giv

Re: Replication lag in Postgres

2024-07-12 Thread Mukesh Tanuku
Thank you for the information Laurenz Albe On Fri, Jul 12, 2024 at 9:13 PM Laurenz Albe wrote: > On Fri, 2024-07-12 at 20:41 +0530, Mukesh Tanuku wrote: > > I have a question with postgres HA setup. > > We are setting up a 2 node postgres cluster with async streaming > repli

Re: Replication lag in Postgres

2024-07-12 Thread Laurenz Albe
On Fri, 2024-07-12 at 20:41 +0530, Mukesh Tanuku wrote: > I have a question with postgres HA setup. > We are setting up a 2 node postgres cluster with async streaming replication, > we want to > define a RPO (Recovery point objective) in case of primary failure.  > > How can

Replication lag in Postgres

2024-07-12 Thread Mukesh Tanuku
Hello everyone. Firstly thanks to the community members who are addressing all the queries that are posted. Those give us more insights about the issues/doubts in the postgres. I have a question with postgres HA setup. We are setting up a 2 node postgres cluster with async streaming replication

Re: Logical Replication - PG_Wall size is too big, What can I do ?

2024-07-09 Thread Laurenz Albe
an this folder without stopping Logical Replication ? The cause is logical replication (probably the initial synchronization of the tables), and the only way to clean that directory is to abort logical replication. PostgreSQL has to retain all WAL (transaction log) until copying the data is done and

Re: Logical replication with temporary tables

2024-07-02 Thread David G. Johnston
On Tuesday, July 2, 2024, Stuart Campbell wrote: > This is a question for AWS. Community PostgreSQL doesn't have any of >> these concepts, and this is all proprietary modifications to PostgreSQL by >> Amazon. > > > Maybe my question can be re-summarised as: do DDL operations on temporary > table

Re: Logical replication with temporary tables

2024-07-02 Thread Christophe Pettus
> On Jul 2, 2024, at 18:16, Stuart Campbell > wrote: > > My understanding was that under the hood, AWS uses the logical replication > features that are present in community Postgres. If that's incorrect then I'm > sorry for the off-topic post. Yes,

Re: Logical replication with temporary tables

2024-07-02 Thread Stuart Campbell
> > This is a question for AWS. Community PostgreSQL doesn't have any of > these concepts, and this is all proprietary modifications to PostgreSQL by > Amazon. My understanding was that under the hood, AWS uses the logical replication features that are present in community Po

Re: Logical replication with temporary tables

2024-07-02 Thread Christophe Pettus
> On Jul 2, 2024, at 17:47, Stuart Campbell > wrote: > My question is whether there is some workaround that will let me create > indexes on a temporary table, and also let me drop the temporary table, in a > way that doesn't end up "degrading" replication? (Pre

Logical replication with temporary tables

2024-07-02 Thread Stuart Campbell
Hello, I'm trying to use a blue/green deployment in Amazon RDS, which uses Postgres logical replication to keep blue and green environments in sync. Some parts of our app use temporary tables, and in some cases we CREATE INDEX on those tables and sometimes DROP and recreate them. The C

Re: Replication After manual Failover

2024-06-25 Thread Ron Johnson
How were you replicating? What was the status of the replication? On Tue, Jun 25, 2024 at 1:20 PM Yongye Serkfem wrote: > Hello Engineer, > Below is the error message I am getting after failing over to the standby > and reconfiguring the former master as the new standby. Any hel

Re: Replication After manual Failover

2024-06-25 Thread Ron Johnson
On Tue, Jun 25, 2024 at 2:39 PM Muhammad Ikram wrote: > Hi, > > Please reinitialize using pg_basebackup > Might not be possible during a switchover. > or use pg_rewind > > > > Muhammad Ikram > Bitnine Global > > > On Tue, 25 Jun 2024 at 22:20, Yongye Serkfem wrote: > >> Hello Engineer, >> Bel

Re: Replication After manual Failover

2024-06-25 Thread Muhammad Ikram
Hi, Please reinitialize using pg_basebackup or use pg_rewind Muhammad Ikram Bitnine Global On Tue, 25 Jun 2024 at 22:20, Yongye Serkfem wrote: > Hello Engineer, > Below is the error message I am getting after failing over to the standby > and reconfiguring the former master as the new stand

Replication After manual Failover

2024-06-25 Thread Yongye Serkfem
Hello Engineer, Below is the error message I am getting after failing over to the standby and reconfiguring the former master as the new standby. Any help will be appreciated. [image: image.png]

Re: Replication using mTLS issue

2024-06-21 Thread Drew Zoellner
Hi Tom, thanks for the response! So the same user is able to connect using a non replication connection using the same mtls certificate and pg_ident.conf map. So it seems like the cert & map are working for this user. hostssl all pgrepmgr_nonprod 100.0.0.0/8 cert map=pgrepmgr_nonprod_map

Re: Replication using mTLS issue

2024-06-21 Thread Tom Lane
Drew Zoellner writes: > So the same user is able to connect using a non replication connection > using the same mtls certificate and pg_ident.conf map. So it seems like the > cert & map are working for this user. Hmph. I tried to reproduce your problem, and it works for me: I

Re: Replication using mTLS issue

2024-06-21 Thread Tom Lane
Drew Zoellner writes: > Hi Postgres team, I’m receiving an issue matching pg_hba rules that I can’t > seem to sort out. I am trying to use mtls certificate authentication for > physical replication connections but keep receiving the following error… > pg_receivewal: error: FATAL: no

Replication using mTLS issue

2024-06-21 Thread Drew Zoellner
Hi Postgres team, I’m receiving an issue matching pg_hba rules that I can’t seem to sort out. I am trying to use mtls certificate authentication for physical replication connections but keep receiving the following error… pg_receivewal: error: FATAL: no pg_hba.conf entry for replication

Re: Monitoring logical replication

2024-06-18 Thread Ron Johnson
being used. I > tried to identify the highest level interface points exposed, i.e. what is > documented on > https://www.postgresql.org/docs/current/replication-origins.html, the > pg_stat_subscription table, the pg_stat_publication table and the > pg_current_wal_lsn() function on th

Re: Monitoring logical replication

2024-06-18 Thread Shaheed Haque
e. what is documented on https://www.postgresql.org/docs/current/replication-origins.html, the pg_stat_subscription table, the pg_stat_publication table and the pg_current_wal_lsn() function on the publisher, but these seem to be barely used. Am I missing something? Thanks, Shaheed P.S. On a relat

Re: Is a VACUUM or ANALYZE necessary after logical replication?

2024-06-16 Thread David G. Johnston
ns > showing primary key indexes. > > Nothing is said about indexes. Maybe for good reason, maybe they are fully > functionality immediately after replication? > > So the main question: Once a table is fully replicated, do I need to > vacuum(analyze) that table, or are the indexes on

Re: Is a VACUUM or ANALYZE necessary after logical replication?

2024-06-15 Thread Achilleas Mantzios
t;index" I could find was in relation to replica identity and examples of table definitions showing primary key indexes. Nothing is said about indexes. Maybe for good reason, maybe they are fully functionality immediately after replication? So the main question: Once a table is fully rep

Re: Is a VACUUM or ANALYZE necessary after logical replication?

2024-06-15 Thread Adrian Klaver
replica identity and examples of table definitions showing primary key indexes. Nothing is said about indexes. Maybe for good reason, maybe they are fully functionality immediately after replication? So the main question: Once a table is fully replicated, do I need to vacuum(analyze) that table,

Is a VACUUM or ANALYZE necessary after logical replication?

2024-06-15 Thread Koen De Groote
for good reason, maybe they are fully functionality immediately after replication? So the main question: Once a table is fully replicated, do I need to vacuum(analyze) that table, or are the indexes on that table already functional? Regards, Koen De Groote

Re: Questions on logical replication

2024-06-13 Thread Justin
be a serious concern, depending on the size of the table. > The number of initial sync workers can be controlled via max_sync_workers_per_subscription see https://www.postgresql.org/docs/current/logical-replication-config.html if you want to do one table at a time just set sync workers to 1. I

Re: Questions on logical replication

2024-06-13 Thread Koen De Groote
did a logical replication upgrade, explaining why they did it this way: https://knock.app/blog/zero-downtime-postgres-upgrades On Wed, Jun 12, 2024 at 7:01 PM Justin wrote: > > > On Tue, Jun 11, 2024 at 5:43 PM Koen De Groote wrote: > >> > If there are any errors during the replay of

Re: Questions on logical replication

2024-06-12 Thread Justin
On Tue, Jun 11, 2024 at 5:43 PM Koen De Groote wrote: > > If there are any errors during the replay of WAL such as missing indexes > for Replica Identities during an Update or Delete this will cause the main > subscriber worker slot on the publisher to start backing up WAL files > > And also if

Re: Questions on logical replication

2024-06-11 Thread Koen De Groote
refreshing the subscriber each time. I'm not planning on using "REPLICA IDENTITY FULL" anywhere. On Sat, Jun 8, 2024 at 10:33 PM Justin wrote: > > On Sat, Jun 8, 2024 at 1:41 PM Koen De Groote wrote: > >> What I'm trying to do is upgrade a PG11 database to PG16, us

Re: Questions on logical replication

2024-06-11 Thread Koen De Groote
there. On Sat, Jun 8, 2024 at 7:46 PM Adrian Klaver wrote: > On 6/8/24 10:40, Koen De Groote wrote: > > What I'm trying to do is upgrade a PG11 database to PG16, using logical > > replication. > > Have you looked at pg_upgrade?: > > https://www.postgresql.org/docs/cur

Question regarding automatically paused streaming replication

2024-06-10 Thread Ian van der Linde
Hi everyone I run a PostgreSQL 14 environment with one primary and two standby instances with streaming replication. I recently had a case where the streaming replication on one of the standby instances paused (seemingly automatically): 2024-06-01 01:11:38.482 CEST [4575476] @ app=LOG

Re: Questions on logical replication

2024-06-08 Thread Justin
On Sat, Jun 8, 2024 at 1:41 PM Koen De Groote wrote: > What I'm trying to do is upgrade a PG11 database to PG16, using logical > replication. > > The PG11 has an active and a standby, there are a handful of databases. On > particular one has a few tables just over 100GB, t

Re: Questions on logical replication

2024-06-08 Thread Adrian Klaver
On 6/8/24 10:40, Koen De Groote wrote: What I'm trying to do is upgrade a PG11 database to PG16, using logical replication. Have you looked at pg_upgrade?: https://www.postgresql.org/docs/current/pgupgrade.html The PG11 has an active and a standby, there are a handful of databases

Re: Questions on logical replication

2024-06-08 Thread Koen De Groote
What I'm trying to do is upgrade a PG11 database to PG16, using logical replication. The PG11 has an active and a standby, there are a handful of databases. On particular one has a few tables just over 100GB, then a few 100 tables near 1GB. What I'd do is start a publication with no

Re: Questions on logical replication

2024-06-07 Thread Adrian Klaver
On 6/6/24 15:19, Koen De Groote wrote: I'll give them a read, though it might take a few weekends Meanwhile, this seems to be what I'm looking for: From https://www.postgresql.org/docs/current/warm-standby.html#STREAMING-REPLICATION-SLOTS <https://www.postgresql.org/docs

RE: Logical replication type- WAL recovery fails and changes the size of wal segment in archivedir

2024-06-07 Thread Meera Nair
Hi Laurenz, Thanks a lot! Regards, Meera -Original Message- From: Laurenz Albe Sent: Wednesday, June 5, 2024 3:56 PM To: Meera Nair ; pgsql-general@lists.postgresql.org Cc: Punit Pranesh Koujalgi ; B Ganesh Kishan Subject: Re: Logical replication type- WAL recovery fails and

RE: Logical replication type- WAL recovery fails and changes the size of wal segment in archivedir

2024-06-07 Thread Meera Nair
tml> Regards, Meera From: Ron Johnson Sent: Thursday, June 6, 2024 9:56 PM To: Laurenz Albe Cc: Meera Nair ; pgsql-general@lists.postgresql.org; Punit Pranesh Koujalgi ; B Ganesh Kishan Subject: Re: Logical replication type- WAL recovery fails and changes the size of wal segment in archivedi

Re: Questions on logical replication

2024-06-06 Thread Kashif Zeeshan
On Fri, Jun 7, 2024 at 3:19 AM Koen De Groote wrote: > I'll give them a read, though it might take a few weekends > > Meanwhile, this seems to be what I'm looking for: > > From > https://www.postgresql.org/docs/current/warm-standby.html#STREAMING-REPLICATION-SLOTS >

Re: Questions on logical replication

2024-06-06 Thread Koen De Groote
I'll give them a read, though it might take a few weekends Meanwhile, this seems to be what I'm looking for: From https://www.postgresql.org/docs/current/warm-standby.html#STREAMING-REPLICATION-SLOTS " Replication slots provide an automated way to ensure that the primary does

Re: Logical replication type- WAL recovery fails and changes the size of wal segment in archivedir

2024-06-06 Thread Ron Johnson
On Wed, Jun 5, 2024 at 6:26 AM Laurenz Albe wrote: > On Wed, 2024-06-05 at 06:36 +, Meera Nair wrote: > > 2024-06-05 11:41:32.369 IST [54369] LOG: restored log file > "00050001006A" from archive > > 2024-06-05 11:41:33.112 IST [54369] LOG: restored log file > "0005000100

Re: Questions on logical replication

2024-06-05 Thread Adrian Klaver
ce, after a checkpoint, WAL segments preceding the one containing the redo record are no longer needed and can be recycled or removed. (When WAL archiving is being done, the WAL segments must be archived before being recycled or removed.)" And this is the same for logical

Re: Questions on logical replication

2024-06-05 Thread Koen De Groote
> needed and can be recycled or removed. (When WAL archiving is being > done, the WAL segments must be archived before being recycled or removed.)" > And this is the same for logical replication and physical replication, I take it. Thus, if a leader has a standby of the same versio

Re: Logical replication type- WAL recovery fails and changes the size of wal segment in archivedir

2024-06-05 Thread Laurenz Albe
On Wed, 2024-06-05 at 06:36 +, Meera Nair wrote: > 2024-06-05 11:41:32.369 IST [54369] LOG:  restored log file > "00050001006A" from archive > 2024-06-05 11:41:33.112 IST [54369] LOG:  restored log file > "00050001006B" from archive > cp: cannot stat ‘/home/pgsql/wmast

Logical replication type- WAL recovery fails and changes the size of wal segment in archivedir

2024-06-05 Thread Meera Nair
Hi team, With wal_level = 'logical', backup was taken using non-exclusive backup method. Following procedure here for restore and recovery - PostgreSQL: Documentation: 16: 26.3. Continuous Archiving and Point-in-Time Recovery (PITR)

Re: Questions on logical replication

2024-06-04 Thread Adrian Klaver
On 6/4/24 15:55, Koen De Groote wrote: I recently read the entire documentation on logical replication, but am left with a question on the buildup of WAL On this page: https://www.postgresql.org/docs/current/logical-replication-subscription.html#LOGICAL-REPLICATION-SUBSCRIPTION-SLOT <ht

Re: Questions on logical replication

2024-06-04 Thread Koen De Groote
Reading this: https://www.postgresql.org/docs/current/warm-standby.html#STREAMING-REPLICATION-SLOTS " Replication slots provide an automated way to ensure that the primary does not remove WAL segments until they have been received by all standbys, and that the primary does not remove rows

Questions on logical replication

2024-06-04 Thread Koen De Groote
I recently read the entire documentation on logical replication, but am left with a question on the buildup of WAL On this page: https://www.postgresql.org/docs/current/logical-replication-subscription.html#LOGICAL-REPLICATION-SUBSCRIPTION-SLOT It is written: " When dropping a subscription

Re: Unexpected data when subscribing to logical replication slot

2024-05-10 Thread Daniel McKenzie
t; > > We've had this running in live now for years without a hiccup so we are > > surprised to learn that we have this massive race condition and it just > > so happens that the hardware is fast enough to process the transaction > > before the .NET application can rea

Scenarios that Replication Slot will be Marked as Active = false

2024-05-10 Thread Avi Weinberg
Hi Experts, I would like to write a monitoring script that will check logical replication running on our setup. For that I would like to know when to alert when I see that replication slot is marked as active= false. I will probably need to know when it is a temporary state that I need to

Re: Unexpected data when subscribing to logical replication slot

2024-05-09 Thread Adrian Klaver
react to replication slot changes. On broad scale I'm going to say that over 'for years' there has been an increase in load on the Postgres server as well as the I/0 system of the machine it is running on. What you are seeing now is the canary in the mine giving you the heads

Re: Unexpected data when subscribing to logical replication slot

2024-05-09 Thread Torsten Förtsch
risk (as a process usually done as part >> of the commit is now being done in the background) but it's not clear how >> that affects a replication slot subscriber. >> >> What we're struggling to understand is: why are we seeing any updates in >> the replica

Re: Unexpected data when subscribing to logical replication slot

2024-05-09 Thread Torsten Förtsch
d of risk (as a process usually done as part > of the commit is now being done in the background) but it's not clear how > that affects a replication slot subscriber. > > What we're struggling to understand is: why are we seeing any updates in > the replication slot before t

Re: Unexpected data when subscribing to logical replication slot

2024-05-09 Thread Adrian Klaver
t of reproducer - ideally a script that sets up an instance + replication, and demonstrates the issue. Or at least a sufficiently detailed steps to reproduce it without having to guess what exactly you did. " The documentation speaks about synchronous_commit changing how transactions change beha

Re: Unexpected data when subscribing to logical replication slot

2024-05-09 Thread Daniel McKenzie
ge behaviour for the client. So in this case, my psql terminal is the client, and I would expect a faster commit (from its perspective) and then a period of risk (as a process usually done as part of the commit is now being done in the background) but it's not clear how that affects a

Re: Unexpected data when subscribing to logical replication slot

2024-05-08 Thread Adrian Klaver
On 5/8/24 08:24, Daniel McKenzie wrote: It's running both (in docker containers) and also quite a few more docker containers running various .NET applications. I think what you found is that the r7a.medium instance is not capable enough to do all that it is asked without introducing lag under

Re: Unexpected data when subscribing to logical replication slot

2024-05-08 Thread Daniel McKenzie
; to > > "off". We cannot reproduce the issue with synchronous_commit set to > > "off". > > What is running on the EC2 instance?: > > 1) The Postgres server. > > 2) The replication receiver. > > 3) Both. > > > > > >

Re: Unexpected data when subscribing to logical replication slot

2024-05-08 Thread Adrian Klaver
off". We cannot reproduce the issue with synchronous_commit set to "off". What is running on the EC2 instance?: 1) The Postgres server. 2) The replication receiver. 3) Both. We need help to understand this unexpected behaviour. We are using Postgres 14.10. Thanks, Dani

Re: Unexpected data when subscribing to logical replication slot

2024-05-08 Thread Tomas Vondra
Hi, On 5/8/24 11:17, Daniel McKenzie wrote: > We have a .NET application which subscribes to a logical replication slot > using wal2json. The purpose of the application is to publish events to AWS > SQS. We are required to first "enrich" these events by querying the > databa

Unexpected data when subscribing to logical replication slot

2024-05-08 Thread Daniel McKenzie
We have a .NET application which subscribes to a logical replication slot using wal2json. The purpose of the application is to publish events to AWS SQS. We are required to first "enrich" these events by querying the database. We have found that these queries will often find old data

pg_basebackup "Permission denied" error when initiating streaming replication

2024-05-07 Thread Frans Simmelvuo (Papula-Nevinpat)
Hi, I'm trying to initiate streaming replication between two Postgres 10 servers on Windows. The source cluster is of size ~450gb, and the cluster consists of the primary data folder, and two separated tablespaces. One of the tablespaces is configured with a symbolic link inside Windows.

Re: Logical Replication Delay on Remote Server

2024-04-23 Thread Ramakrishna m
Hi Team, adding one more point here, 5. Pg_stat_replication_slot total_txn count reduces when lag occurs .Does decoding stop in case of logical replication delay? On Tue, 23 Apr 2024 at 22:55, Ramakrishna m wrote: > Hi Team, > > I am facing replication lag in postgres16 at times

Logical Replication Delay on Remote Server

2024-04-23 Thread Ramakrishna m
Hi Team, I am facing replication lag in postgres16 at times,not able to find the reason. Please find the configuration: 1) Two replication slots for two servers (1 is the same data center, another remote) 2) weekly once/twice facing lag(around 2GB for 1k TPS environment) in the remote

Re: Failing streaming replication on PostgreSQL 14

2024-04-22 Thread Nicolas Seinlet
Hi, facing the same situation again, but this time, analyzing the wal with xxd shows a different pattern. I had no blocks of . The output of pg_waldump is: pg_waldump: fatal: error in WAL record at 11C/93F9FF70: invalid magic number in log segment 0001011C0093, offset 16384

Re: replication slot "pg_1015733_sync_1014718_7358407382484881476" does not exist

2024-04-17 Thread Justin
Hi Avi, Based on the slot name this is an initial sync worker being created by the Logical Replication supervisor. Subscriber started an initial sync either failed to create the slot and now thinks it exists and keeps trying to drop it on the publisher or another process dropped the slot on the

replication slot "pg_1015733_sync_1014718_7358407382484881476" does not exist

2024-04-17 Thread Avi Weinberg
Fixed a typo... Hi Experts, For a second time in the past few months I'm getting the following errors in Postgres log. Last time it was solved when I reset all Postgres pods. Now reset no longer helps. Logical replication is not working even after I performed the reset. Any ideas wh

replication slot "pg_1015733_sync_1014718_7358407382484881476" does not exist

2024-04-17 Thread Avi Weinberg
Hi Experts, For a second time in the past few months I'm getting the following errors in Postgres log. Last time it was solved when I reset all Postgres pods. Now reset no longer helps. Logical replication is now working even after I performed the reset. Any ideas what is wrong?

  1   2   3   4   5   6   7   8   9   10   >