Re: pg_upgrade and wraparound

From: Andres Freund <andres(at)anarazel(dot)de>
To: Alexander Shutyaev <shutyaev(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg_upgrade and wraparound
Date: 2018-06-11 17:03:44
Message-ID: 20180611170344.nugxbq5xnjcnbn7y@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

On 2018-06-09 13:46:16 +0300, Alexander Shutyaev wrote:
> Hello!
>
> I've been trying to upgrade a postgresql cluster from 9.6 to 10. I've
> executed the pg_upgrade with the following options:
>
> /usr/lib/postgresql/10/bin/pg_upgrade -b /usr/lib/postgresql/9.6/bin/ -B
> /usr/lib/postgresql/10/bin/ -d /var/lib/postgresql/9.6/main -D
> /var/lib/postgresql/10/main -o ' -c
> config_file=/etc/postgresql/9.6/main/postgresql.conf' -O ' -c
> config_file=/etc/postgresql/10/main/postgresql.conf'
>
> The upgrade operation failed after several hours with the following error:
>
> database is not accepting commands to avoid wraparound data loss in
> database with OID 0
>
> Earlier in the log there are a lot of messages like
>
> pg_restore: executing BLOB 1740736966
> pg_restore: WARNING: database with OID 0 must be vacuumed within 1000279
> transactions
> HINT: To avoid a database shutdown, execute a database-wide VACUUM in that
> database.
> You might also need to commit or roll back old prepared transactions.

Since this happens in the version you're migrating too, I suggest
replacing the warning with a PANIC and then using the debugger to look
at the corefile generated (when using an appropriate ulimit). It's not
immediately obvious why there'd not be correct knowledge about the
oldest database around. If you do so, please include 'p *ShmemVariableCache'
output.

Greetings,

Andres Freund

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andres Freund 2018-06-11 17:08:12 Re: pg_upgrade and wraparound
Previous Message Adrian Klaver 2018-06-11 17:00:05 Re: Sort is generating rows