From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Harris <michael.harris@ericsson.com>
Cc: 'pgsql-general@lists.postgresql.org' <pgsql-general@lists.postgresql.org>
Subject: Re: ERROR: invalid memory alloc request size when committing transaction
Date: Wed, 11 Aug 2021 23:40:38 -0400
Message-ID: <4045762.1628739638@sss.pgh.pa.us> (raw)
In-Reply-To: <AM9PR07MB784434F87D9611CC662E313EF3F99@AM9PR07MB7844.eurprd07.prod.outlook.com>
References: <AM9PR07MB784434F87D9611CC662E313EF3F99@AM9PR07MB7844.eurprd07.prod.outlook.com>
Michael Harris <michael.harris@ericsson.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@218006 218015@[local] db_vrqv1 ERROR: invalid memory alloc request size 1073741824
> [2021-08-11 11:27:50 CEST] aue_75@218006 218015@[local] db_vrqv1 STATEMENT: commit
> [2021-08-11 11:27:50 CEST] aue_75@218006 218015@[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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, michael.harris@ericsson.com
Subject: Re: ERROR: invalid memory alloc request size when committing transaction
In-Reply-To: <4045762.1628739638@sss.pgh.pa.us>
References: <AM9PR07MB784434F87D9611CC662E313EF3F99@AM9PR07MB7844.eurprd07.prod.outlook.com> <4045762.1628739638@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox