pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dischner, Anton <Anton.Dischner@med.uni-muenchen.de>
To: 'Антон Глушаков' <a.glushakov86@gmail.com>
To: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: AW: pg_dump --binary-upgrade out of memory
Date: Wed, 14 Feb 2024 07:11:00 +0000
Message-ID: <e0bd4eb1253645558bc18c63de13ef7a@med.uni-muenchen.de> (raw)
In-Reply-To: <CAHnOmaeCZN0tOEfmu3VOLjDujfY2jbS0HaEfwTboY1knhfwzvQ@mail.gmail.com>
References: <CAHnOmaeCZN0tOEfmu3VOLjDujfY2jbS0HaEfwTboY1knhfwzvQ@mail.gmail.com>

Hi,

-Hi.
-I encountered the problem of not being able to upgrade my instance (14->15) via pg_upgrade.
-The utility crashed with an error in out of memory.-
-After researching a bit I found that this happens at the moment of export schema  with pg_dump.

-Then I tried to manually perform a dump schema with the parameter --binary-upgrade option and also got an out of memory.
-Digging a little deeper, I discovered quite a large number of blob objects in the database (pg_largeobject 10GB and pg_largeobject_metadata 1GB (31kk rows))
-I was able to reproduce the problem on a clean server by simply putting some random data in pg_largeobject_metadata

-$insert into pg_largeobject_metadata (select i,16390 from generate_series(107659,34274365) as i);

-$pg_dump --binary-upgrade --format=custom -d mydb -s -f tmp.dmp
-and after 1-2 min get out of memory ( i tried on server with 4 and 8 gb RAM)

-Perhaps this is a bug? How can I perform an upgrade?

a quick and dirty solution might be an additional temporary swap space like this https://en.euro-linux.com/blog/creating-a-swap-file-or-how-to-deal-with-a-temporary-memory-shortage/

best,

Anton




Message-ID: <e0bd4eb1253645558bc18c63de13ef7a@med.uni-muenchen.de>
Permalink:  ../e0bd4eb1253645558bc18c63de13ef7a@med.uni-muenchen.de/
Also on:    postgresql.org/message-id/e0bd4eb1253645558bc18c63de13ef7a@med.uni-muenchen.de

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: Anton.Dischner@med.uni-muenchen.de, a.glushakov86@gmail.com, pgsql-admin@lists.postgresql.org
  Subject: Re: AW: pg_dump --binary-upgrade out of memory
  In-Reply-To: <e0bd4eb1253645558bc18c63de13ef7a@med.uni-muenchen.de>

* 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