Re: why there is not VACUUM FULL CONCURRENTLY?

Antonin Houska <ah@cybertec.at>

From: Antonin Houska <ah@cybertec.at>
To: Junwang Zhao <zhjwpku@gmail.com>
Cc: Kirill Reshke <reshkekirill@gmail.com>, Alvaro Herrera <alvherre@alvh.no-ip.org>, Pavel Stehule <pavel.stehule@gmail.com>, Michael Paquier <michael@paquier.xyz>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2024-10-09T12:56:17Z
Lists: pgsql-hackers

Attachments

Junwang Zhao <zhjwpku@gmail.com> wrote:

> + if (TransactionIdIsNormal(HeapTupleHeaderGetRawXmax(tuple->t_data)) &&
> + HeapTupleMVCCNotDeleted(tuple, snapshot, buffer))
> + {
> + /* TODO More work needed here?*/
> + tuple->t_data->t_infomask |= HEAP_XMAX_INVALID;
> + HeapTupleHeaderSetXmax(tuple->t_data, 0);
> + }
> 
> I don't quite understand the above code, IIUC xmax and xmax invalid
> are set directly on the buffer page. What if the command failed? Will
> this break the visibility rules?

Oh, that's too bad. Of course, the tuple must be copied. Fixed in the next
version. Thanks!

(0009- added to get some debugging information from the cfbot. It fails
sometimes and I'm not able to reproduce the errors.)

-- 
Antonin Houska
Web: https://www.cybertec-postgresql.com

Commits

  1. Add CONCURRENTLY option to REPACK

  2. Introduce the REPACK command

  3. Adjust signature of cluster_rel() and its subroutines

  4. Simplify signature of RewriteTable