Re: why there is not VACUUM FULL CONCURRENTLY?

From: Antonin Houska <ah(at)cybertec(dot)at>
To: Junwang Zhao <zhjwpku(at)gmail(dot)com>
Cc: Kirill Reshke <reshkekirill(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: why there is not VACUUM FULL CONCURRENTLY?
Date: 2024-10-09 12:56:17
Message-ID: 62605.1728478577@antos
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Junwang Zhao <zhjwpku(at)gmail(dot)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

Attachment Content-Type Size
v05-0001-Adjust-signature-of-cluster_rel-and-its-subroutines.patch text/x-diff 14.9 KB
v05-0002-Move-progress-related-fields-from-PgBackendStatus-to.patch text/x-diff 6.4 KB
v05-0003-Move-conversion-of-a-historic-to-MVCC-snapshot-to-a-.patch text/x-diff 5.4 KB
v05-0004-Add-CONCURRENTLY-option-to-both-VACUUM-FULL-and-CLUS.patch text/plain 170.9 KB
v05-0005-Preserve-visibility-information-of-the-concurrent-da.patch text/x-diff 39.0 KB
v05-0006-Add-regression-tests.patch text/x-diff 10.4 KB
v05-0007-Introduce-cluster_max_xlock_time-configuration-varia.patch text/x-diff 20.4 KB
v05-0008-Call-logical_rewrite_heap_tuple-when-applying-concur.patch text/x-diff 26.6 KB
v05-0009-elog.patch text/x-diff 2.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2024-10-09 13:08:52 Allow default \watch interval in psql to be configured
Previous Message Andrew Dunstan 2024-10-09 12:45:14 Re: Should CSV parsing be stricter about mid-field quotes?