Re: Logical replication from PostgreSQL 10.23 to 16.3, last two big tables (getting synced) just keep growing

From: Achilleas Mantzios <a(dot)mantzios(at)cloud(dot)gatewaynet(dot)com>
To: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: Logical replication from PostgreSQL 10.23 to 16.3, last two big tables (getting synced) just keep growing
Date: 2024-06-12 18:09:26
Message-ID: 389ff6ad-cae4-42c0-9925-4b562779b872@cloud.gatewaynet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Στις 12/6/24 20:14, ο/η Achilleas Mantzios έγραψε:
>
> Hello
>
> as the subject says, we are trying to test a migration plan from 10.23
> to 16.3, using logical replication to new OS, + checksums  + ICU +
> SQL_ASCII -> UTF-8, (some of which proved to be a challenge).  After
> solving all of the problems, and repeating the process, now it seems
> the system got into a weird state, in which all of the ~ 930 tables
> got synced correctly , except the two largest ones. The DB in total
> (in its 10.23 version) takes up 4.6 TB. In 16.3 it has already taken
> 4.8 and keep growing. No ERRORs or ROLLBACKS that would justify the
> growth (to my limited knowledge).
>
> Those two tables keep growing and growing in the 16.3 (subscriber) DB.
>
> In 10.23 (publisher)
>
> postgres(at)[local]/dynacom=# select pg_total_relation_size(oid),
> pg_size_pretty(pg_total_relation_size(oid)), oid::regclass from
> pg_class where  oid in ('marin
> erpapers_atts'::regclass,'marinerpapers_atts_tmp'::regclass);
> pg_total_relation_size | pg_size_pretty |          oid
> ------------------------+----------------+------------------------
>          1082956537856 | 1009 GB        | marinerpapers_atts
>           973440409600 | 907 GB         | marinerpapers_atts_tmp
> (2 rows)
>
> postgres(at)[local]/dynacom=#
>
> In 16.3 (subscriber)
>
> postgres(at)[local]/dynacom=# select pg_total_relation_size(oid),
> pg_size_pretty(pg_total_relation_size(oid)), oid::regclass from
> pg_class where  oid in ('marin
> erpapers_atts'::regclass,'marinerpapers_atts_tmp'::regclass);
> pg_total_relation_size | pg_size_pretty |          oid
> ------------------------+----------------+------------------------
>          1301943779328 | 1213 GB        | marinerpapers_atts
>          1295188762624 | 1206 GB        | marinerpapers_atts_tmp
> (2 rows)
>
>  The weird thing is that for every single table of the rest of the big
> ones, the size on the new machine seems smaller :
>
> 10.23 :
>
> postgres(at)[local]/dynacom=# select pg_total_relation_size(oid),
> pg_size_pretty(pg_total_relation_size(oid)), oid::regclass from
> pg_class where relkind in ('r'
> ,'p','m') order by 1 DESC LIMIT 10 OFFSET 2;
> pg_total_relation_size | pg_size_pretty |          oid
> ------------------------+----------------+-----------------------
>           634434142208 | 591 GB         | mail_entity
>           568166334464 | 529 GB         | fb_reports_files
>           538761527296 | 502 GB         | vmanews
>           115932397568 | 108 GB         | approval_request_docs
>           107413241856 | 100 GB         | status
>            86767763456 | 81 GB          | fb_reports_dets
>            82120941568 | 76 GB          | items_atts
>            81043136512 | 75 GB          | items_atts_tmp
>            59618181120 | 56 GB          | logging
>            58586382336 | 55 GB          | apm_evidence
> (10 rows)
>
> 16.3
>
> postgres(at)[local]/dynacom=# select pg_total_relation_size(oid),
> pg_size_pretty(pg_total_relation_size(oid)), oid::regclass from
> pg_class where relkind in ('r'
> ,'p','m') order by 1 DESC LIMIT 10 OFFSET 2;
> pg_total_relation_size | pg_size_pretty |          oid
> ------------------------+----------------+-----------------------
>           542910595072 | 506 GB         | fb_reports_files
>           515205160960 | 480 GB         | vmanews
>           491888680960 | 458 GB         | mail_entity
>           115919945728 | 108 GB         | approval_request_docs
>            82050457600 | 76 GB          | items_atts
>            80889028608 | 75 GB          | items_atts_tmp
>            64453533696 | 60 GB          | fb_reports_dets
>            57055133696 | 53 GB          | apm_evidence
>            55286161408 | 51 GB          | logging
>            52352860160 | 49 GB          | status
> (10 rows)
>
> For what it's worth, I restarted the target (subscriber) 16.3 DB today
> after compiling for JIT.  I know 10.23 is dead but anyways,  any clues
> or any advice would be great.
>
The two COPY processes on the publisher are CPU active since about
11:27:00 EEST in the morning.
> --
> Achilleas Mantzios
> IT DEV - HEAD
> IT DEPT
> Dynacom Tankers Mgmt (as agents only)

--
Achilleas Mantzios
IT DEV - HEAD
IT DEPT
Dynacom Tankers Mgmt (as agents only)

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Achilleas Mantzios 2024-06-12 19:46:14 Re: Logical replication from PostgreSQL 10.23 to 16.3, last two big tables (getting synced) just keep growing
Previous Message Achilleas Mantzios 2024-06-12 17:14:47 Logical replication from PostgreSQL 10.23 to 16.3, last two big tables (getting synced) just keep growing