Re: ERROR: invalid memory alloc request size when committing transaction

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Harris <michael(dot)harris(at)ericsson(dot)com>
Cc: "'pgsql-general(at)lists(dot)postgresql(dot)org'" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: ERROR: invalid memory alloc request size when committing transaction
Date: 2021-08-12 03:40:38
Message-ID: 4045762.1628739638@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Michael Harris <michael(dot)harris(at)ericsson(dot)com> writes:
> - Next we run a migration script on each database in the cluster. The migration script
> converts a large number of tables from inheritance based partitioning to declarative
> partitioning. Unfortunately I am not at liberty to share the migration script.

How many is "a large number"?

> The migration is performed inside a transaction, and during the process of committing the
> transaction the following error is thrown:
> [2021-08-11 11:27:50 CEST] aue_75(at)218006 218015(at)[local] db_vrqv1 ERROR: invalid memory alloc request size 1073741824
> [2021-08-11 11:27:50 CEST] aue_75(at)218006 218015(at)[local] db_vrqv1 STATEMENT: commit
> [2021-08-11 11:27:50 CEST] aue_75(at)218006 218015(at)[local] db_vrqv1 WARNING: AbortTransaction while in COMMIT state

It's impossible to do more than speculate with this amount of information.
However, a plausible speculation is that you're processing so many objects
in one transaction as to overrun the limit on how large a WAL commit record,
or something related to that, can be. Can you adjust your migration
script to break it into multiple transactions that process fewer tables
per transaction?

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Harris 2021-08-12 05:42:44 RE: ERROR: invalid memory alloc request size when committing transaction
Previous Message A Z 2021-08-12 02:54:03 Serious Assistance with PostgreSQL True Infinite Arbitrary Precision Maths.