Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Alexey Kondratov <a(dot)kondratov(at)postgrespro(dot)ru>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Masahiko Sawada <masahiko(dot)sawada(at)2ndquadrant(dot)com>, Steve Singer <steve(at)ssinger(dot)info>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Robert Haas <robertmhaas(at)gmail(dot)com>, Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Jose Luis Tallon <jltallon(at)adv-solutions(dot)net>
Subject: Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly
Date: 2021-01-27 21:35:03
Message-ID: 20210127213503.GX30745@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thanks for updating the patch. I have just a couple comments on the new (and
old) language.

On Thu, Jan 28, 2021 at 12:19:06AM +0300, Alexey Kondratov wrote:
> Also added tests for ACL checks, relfilenode changes. Added ACL recheck for
> multi-transactional case. Added info about TOAST index reindexing. Changed
> some comments.

> + Specifies that indexes will be rebuilt on a new tablespace.
> + Cannot be used with "mapped" and system (unless <varname>allow_system_table_mods</varname>

say mapped *or* system relations
Or maybe:
mapped or (unless >allow_system_table_mods<) system relations.

> + is set to <literal>TRUE</literal>) relations. If <literal>SCHEMA</literal>,
> + <literal>DATABASE</literal> or <literal>SYSTEM</literal> are specified,
> + then all "mapped" and system relations will be skipped and a single
> + <literal>WARNING</literal> will be generated. Indexes on TOAST tables
> + are reindexed, but not moved the new tablespace.

moved *to* the new tablespace.
I don't know if that needs to be said at all. We talked about it a lot to
arrive at the current behavior, but I think that's only due to the difficulty
of correcting the initial mistake.

> + /*
> + * Set the new tablespace for the relation. Do that only in the
> + * case where the reindex caller wishes to enforce a new tablespace.

I'd say just "/* Set new tablespace, if requested */
You wrote something similar in an earlier revision of your refactoring patch.

> + * Mark the relation as ready to be dropped at transaction commit,
> + * before making visible the new tablespace change so as this won't
> + * miss things.

This comment is vague. I think Michael first wrote this comment about a year
ago. Does it mean "so the new tablespace won't be missed" ? Missed by what ?

--
Justin

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Rofail 2021-01-27 21:36:51 Re: [HACKERS] GSoC 2017: Foreign Key Arrays
Previous Message Bossart, Nathan 2021-01-27 21:29:08 Re: archive status ".ready" files may be created too early