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 17:56:49
Message-ID: 79b7d5dc-3a1d-4ef0-9a3d-055268dc7d09@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 1/21/25 09:38, Durgamahesh Manne wrote:
>
>

>
> Hi Adrian Klaver
>
> Really Thanks for your quick response
>
> This happened during repack lag went to more than 350Gb then gradually
> decreased to minimal lag after running pg_repack

I don't use pg_repack so I don't know what effect it would have on the
process.
>

> 3) Define how lag is being calculated and what 'minimal' is.
>
> postgres=> select
> slot_name,pg_wal_lsn_diff(pg_current_wal_lsn(),restart_lsn) as bytes_behind,
> pg_size_pretty(pg_wal_lsn_diff(pg_current_wal_lsn(), restart_lsn)) as
> behind_size, active from pg_replication_slots;
>   slot_name  | bytes_behind | behind_size | active
> -------------+--------------+-------------+--------
>  cls_eva_msa |     22906216 | 22 MB       | t
>
> 4) Define how the record counts are being derived.
>   Source : archiving=> select count(*) from archiving.events_archive ;
>   count
> ---------
>  1262908
> (1 row)
>
> Destination : archiving=> select count(*) from archiving.events_archive ;
>   count
> ---------
>  1252062
> (1 row)

22,906,216 bytes/10,846 rows works out to 2112 bytes per row.

Is that a reasonable per row estimate?

>
> 5) The network distance between the servers.
>
>  Both are under same vpc security groups
>
> Regards
> Durga Mahesh

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Brent Wood 2025-01-21 18:02:01 Re: concatenating hstores in a group by?
Previous Message Durgamahesh Manne 2025-01-21 17:38:42 Re: Records count mismatch with logical replication