pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Cancelling "vacuum full" in single user mode?
3+ messages / 3 participants
[nested] [flat]

* Cancelling "vacuum full" in single user mode?
@ 2023-10-02 12:38  Colin 't Hart <colin@sharpheart.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Colin 't Hart @ 2023-10-02 12:38 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

Hi,

I have a customer approaching transaction wraparound, about 3million
transaction IDs away at the moment.
Postgres 9.5 (yes, I know...)

Somewhat mislead by the message to vacuum the database in single user
mode, they are now in single user mode and are running "vacuum full"
on the "worst" database, which has 18.5 million tables, and is about
350GB on disk.

Now we want to cancel the "vacuum full" and run a "vacuum freeze"
instead... or preferably, start back up in multiuser mode and run
vacuum there, but that was running very slowly while autovacuum was
trying to run (so we would need to disable that too, for now).

So,

1. Can we cancel safely?
2. Any other suggestions? Upgrade to a newer version right now?

/Colin





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Cancelling "vacuum full" in single user mode?
@ 2023-10-02 12:39  Colin 't Hart <colinthart@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Colin 't Hart @ 2023-10-02 12:39 UTC (permalink / raw)
  To: pgsql-general

Hi,

I have a customer approaching transaction wraparound, about 3million
transaction IDs away at the moment.
Postgres 9.5 (yes, I know...)

Somewhat mislead by the message to vacuum the database in single user
mode, they are now in single user mode and are running "vacuum full"
on the "worst" database, which has 18.5 million tables, and is about
350GB on disk.

Now we want to cancel the "vacuum full" and run a "vacuum freeze"
instead... or preferably, start back up in multiuser mode and run
vacuum there, but that was running very slowly while autovacuum was
trying to run (so we would need to disable that too, for now).

So,

1. Can we cancel safely?
2. Any other suggestions? Upgrade to a newer version right now?

/Colin





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Cancelling "vacuum full" in single user mode?
@ 2023-10-02 13:59  Laurenz Albe <laurenz.albe@cybertec.at>
  parent: Colin 't Hart <colinthart@gmail.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Laurenz Albe @ 2023-10-02 13:59 UTC (permalink / raw)
  To: Colin 't Hart <colinthart@gmail.com>; pgsql-general

On Mon, 2023-10-02 at 14:39 +0200, Colin 't Hart wrote:
> I have a customer approaching transaction wraparound, about 3million
> transaction IDs away at the moment.
> Postgres 9.5 (yes, I know...)
> 
> Somewhat mislead by the message to vacuum the database in single user
> mode, they are now in single user mode and are running "vacuum full"
> on the "worst" database, which has 18.5 million tables, and is about
> 350GB on disk.
> 
> Now we want to cancel the "vacuum full" and run a "vacuum freeze"
> instead... or preferably, start back up in multiuser mode and run
> vacuum there, but that was running very slowly while autovacuum was
> trying to run (so we would need to disable that too, for now).
> 
> So,
> 
> 1. Can we cancel safely?
> 2. Any other suggestions? Upgrade to a newer version right now?

VACUUM (FULL) is exactly the wrong thing to do, so yes, cancel that.

Normally you don't need single-user mode, since VACUUM does not consume
a transaction ID.

I'd run

  SELECT oid::regclass AS table_name, age(relfrozenxid) AS oldest_unfrozen_row
  FROM pg_class
  WHERE relkind = 'r'
  ORDER BY age(relfrozenxid) DESC;

And VACUUM the tables (FREEZE is not necessary) starting with the top ones
on the list.

Upgrade as soon as possible.  Not only are you missing out on tons of fixed
bugs, but VACUUM performance and smartness has greatly improved since 9.5.

Yours,
Laurenz Albe





^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2023-10-02 13:59 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-10-02 12:38 Cancelling "vacuum full" in single user mode? Colin 't Hart <colin@sharpheart.org>
2023-10-02 12:39 Cancelling "vacuum full" in single user mode? Colin 't Hart <colinthart@gmail.com>
2023-10-02 13:59 ` Laurenz Albe <laurenz.albe@cybertec.at>

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