Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly
Justin Pryzby <pryzby@telsasoft.com>
From: Justin Pryzby <pryzby@telsasoft.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>, Alexey Kondratov <a.kondratov@postgrespro.ru>, Masahiko Sawada <masahiko.sawada@2ndquadrant.com>, Steve Singer <steve@ssinger.info>, pgsql-hackers@lists.postgresql.org, Robert Haas <robertmhaas@gmail.com>, Alexander Korotkov <a.korotkov@postgrespro.ru>, Masahiko Sawada <sawada.mshk@gmail.com>, Jose Luis Tallon <jltallon@adv-solutions.net>
Date: 2020-09-02T04:56:44Z
Lists: pgsql-hackers
Attachments
On Tue, Sep 01, 2020 at 09:24:10PM -0500, Justin Pryzby wrote: > On Wed, Sep 02, 2020 at 10:00:12AM +0900, Michael Paquier wrote: > > On Tue, Sep 01, 2020 at 11:48:30AM -0400, Alvaro Herrera wrote: > > > On 2020-Sep-01, Justin Pryzby wrote: > > >> The question isn't whether to use a parenthesized option list. I realized that > > >> long ago (even though Alexey didn't initially like it). Check 0002, which gets > > >> rid of "bool concurrent" in favour of stmt->options&REINDEXOPT_CONCURRENT. > > > > > > Ah! I see, sorry for the noise. Well, respectfully, having a separate > > > boolean to store one option when you already have a bitmask for options > > > is silly. > > > > Yeah, I am all for removing "concurrent" from ReindexStmt, but I don't > > think that the proposed 0002 is that, because it is based on the > > assumption that we'd want more than just boolean-based options in > > those statements, and this case is not justified yet except if it > > becomes possible to enforce tablespaces. At this stage, I think that > > it is more sensible to just update gram.y and add a > > REINDEXOPT_CONCURRENTLY. I also think that it would also make sense > > to pass down "options" within ReindexIndexCallbackState() (for example > > imagine a SKIP_LOCKED for REINDEX). > > Uh, this whole thread is about implementing REINDEX (TABLESPACE foo), and the > preliminary patch 0001 is to keep separate the tablespace parts of that > content. 0002 is a minor tangent which I assume would be squished into 0001 > which cleans up historic cruft, using new params in favour of historic options. > > I think my change is probably incomplete, and ReindexStmt node should not have > an int options. parse_reindex_params() would parse it into local int *options > and char **tablespacename params. Done in the attached, which is also rebased on 1d6541666. And added RelationAssumeNewRelfilenode() as I mentioned - but I'm hoping to hear from Michael about any reason not to call RelationSetNewRelfilenode() instead of directly calling the things it would itself call. -- Justin
Commits
-
Add TABLESPACE option to REINDEX
- c5b286047cd6 14.0 landed
-
Refactor code in tablecmds.c to check and process tablespace moves
- 4c9c359d38ff 14.0 landed
-
Refactor option handling of CLUSTER, REINDEX and VACUUM
- a3dc926009be 14.0 landed
-
pg_dump: Don't use enums for defining bit mask values
- d2a2808eb444 14.0 landed
-
Refactor CLUSTER and REINDEX grammar to use DefElem for option lists
- b5913f612079 14.0 landed
-
Refactor parsing rules for option lists of EXPLAIN, VACUUM and ANALYZE
- 873ea9ee692e 14.0 landed
-
Improve tab completion of REINDEX in psql
- 1f75b454134c 14.0 landed
-
Fix possible crash during FATAL exit from reindexing.
- d12bdba77b0f 13.0 cited