Re: Records count mismatch with logical replication

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Durgamahesh Manne <maheshpostgres9(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Records count mismatch with logical replication
Date: 2025-01-23 16:38:02
Message-ID: aa3168eb-f529-4e4a-bcb7-e01140ef5b3f@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 1/22/25 18:53, Durgamahesh Manne wrote:
>
>
>

> > But records count varies with difference of more than 10 thousand
>
> Have you looked at the I/0 statistics between the Postgres instances?
>
> Seems everything looks good with pg replication slots

Except the subscriber is lagging behind the publisher.

'... everything looks good' is an opinion not actual data.

>
> Does this pg logical slot get changes function help to pull pending
> changes to subscription that can be sync with publication server for
> real time sync ?

Are you referring to this?:

https://www.postgresql.org/docs/current/warm-standby.html#SYNCHRONOUS-REPLICATION

Though I am not sure you want to do this as from above:

"When requesting synchronous replication, each commit of a write
transaction will wait until confirmation is received that the commit has
been written to the write-ahead log on disk of both the primary and
standby server. The only possibility that data can be lost is if both
the primary and the standby suffer crashes at the same time. This can
provide a much higher level of durability, though only if the sysadmin
is cautious about the placement and management of the two servers.
Waiting for confirmation increases the user's confidence that the
changes will not be lost in the event of server crashes but it also
necessarily increases the response time for the requesting transaction.
The minimum wait time is the round-trip time between primary and standby."

If you are not referring to above then you will need to explain further.

>
> Regards,
> Durgamahesh
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2025-01-23 16:47:53 Re: Return of the pg_wal issue..
Previous Message Adrian Klaver 2025-01-23 16:07:26 Re: Return of the pg_wal issue..