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-21 21:40:57
Message-ID: 44e3ca5d-fcbd-4f96-a6a6-09becff15cd7@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 1/21/25 11:40, Durgamahesh Manne wrote:
>
>
> On Wed, 22 Jan, 2025, 00:22 Adrian Klaver, <adrian(dot)klaver(at)aklaver(dot)com
> <mailto:adrian(dot)klaver(at)aklaver(dot)com>> wrote:
>
>
>
> On 1/21/25 10:06 AM, Durgamahesh Manne wrote:
>
> >
> > Hi Adrian Klaver
> >
> > 22,906,216 bytes/10,846 rows  works out to 2112 bytes per row.
> >
> > Is that a reasonable per row estimate?
> >
> > Yes  sometimes would be vary
>
> If I am following the lag went from 350GB behind to 22MB.
>
> Is the issue that the lag has stalled at 22MB?
>
> >
> > Regards,
> > Durga Mahesh
> >
>
> --
> Adrian Klaver
> adrian(dot)klaver(at)aklaver(dot)com <mailto:adrian(dot)klaver(at)aklaver(dot)com>
>
>
> Hi Adrian Klaver
>
> Is the issue that the lag has stalled at 22MB?
>
> Depends on load of source
> The lag would be either decrease or increase in Kb 's and Mb's (not Gb's)
> It s not constant as Data being replicated to target

Previously you stated:

"Both are under same vpc security groups"

Does this refer to AWS?

If so per:

https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html

"The following diagram shows an example VPC. The VPC has one subnet in
each of the Availability Zones in the Region, EC2 instances in each
subnet, and an internet gateway to allow communication between the
resources in your VPC and the internet."

So where are the two Postgres instances physically located relative to
each other?

>
> But records count varies with difference of more than 10 thousand

Have you looked at the I/0 statistics between the Postgres instances?

>
> How to mitigate this issue in simplest way ?

Until it is determined what is causing the lag there is no way to deal
with it.

>
> Regards
> Durga Mahesh

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2025-01-22 00:29:13 Re: concatenating hstores in a group by?
Previous Message Durgamahesh Manne 2025-01-21 19:40:34 Re: Records count mismatch with logical replication