| From: | Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> |
|---|---|
| To: | Nathan Bossart <nathandbossart(at)gmail(dot)com> |
| Cc: | Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org, alvherre(at)kurilemu(dot)de |
| Subject: | Re: REPACK (CONCURRENTLY) doesn't check the table AM |
| Date: | 2026-08-27 19:48:53 |
| Message-ID: | CAD21AoBryYaDcwGhBhFQrfZ76f_kQFv3QpCo5e34YKn9iau2HQ@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Thu, Aug 27, 2026 at 12:16 PM Nathan Bossart
<nathandbossart(at)gmail(dot)com> wrote:
>
> On Thu, Aug 27, 2026 at 11:59:10AM -0700, Bharath Rupireddy wrote:
> > On Thu, Aug 27, 2026 at 9:23 AM Nathan Bossart <nathandbossart(at)gmail(dot)com> wrote:
> >> REPACK (CONCURRENTLY) replays changes by decoding them from WAL, so it
> >> needs the table AM to be logically decodable, but
> >> check_concurrent_repack_requirements() doesn't check that. Should it be
> >> restricted to heap for v19?
> >
> > Logical decoding doesn't check the table AM type, but goes ahead and
> > decodes the WAL records (for that matter, none of CLUSTER, VACUUM
> > FULL, and REPACK have checks on table AM. They hand off at some point
> > to the table AM layer). I'm not sure if gating it just for concurrent
> > repack is the right choice. Is it that we want to have it just for
> > concurrent repack since it's new code with a new logical decoding
> > plugin and we want some field reports of needing it for other table
> > AMs?
>
> If the other commands are similarly broken, then perhaps this isn't a valid
> open item for v19. But IIUC concurrent repack is the only one of the
> commands you listed that depends on logical decoding, and if the table AM
> doesn't support that, then it won't work properly.
If the table AM doesn't support logical decoding, concurrent repack
would silently lose some table data as it misses the changes
happened during the rewrites. I think we should have the check for it.
One idea would be to have a new table AM callback returning true if
the table AM supports concurrent repack (i.e., its rmgr provides
rm_decode callback), but I think it's not the right time to introduce
a new table AM callback. So restricting it to heap for v19 seems fine
to me.
Regards,
--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Matheus Alcantara | 2026-08-27 19:52:32 | Re: REPACK (CONCURRENTLY) fails when table owner lacks CONNECT |
| Previous Message | Bharath Rupireddy | 2026-08-27 19:40:44 | Re: REPACK (CONCURRENTLY) fails when table owner lacks CONNECT |