Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly
Alexey Kondratov <a.kondratov@postgrespro.ru>
From: Alexey Kondratov <a.kondratov@postgrespro.ru>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: Michael Paquier <michael@paquier.xyz>, Masahiko Sawada
<masahiko.sawada@2ndquadrant.com>, Steve Singer <steve@ssinger.info>,
pgsql-hackers@lists.postgresql.org, Alvaro Herrera
<alvherre@2ndquadrant.com>, 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-01T10:36:38Z
Lists: pgsql-hackers
On 2020-09-01 13:12, Justin Pryzby wrote: > This patch seems to be missing a call to RelationAssumeNewRelfilenode() > in > reindex_index(). > > That's maybe the related to the cause of the crashes I pointed out > earlier this > year. > > Alexey's v4 patch changed RelationSetNewRelfilenode() to accept a > tablespace > parameter, but Michael seemed to object to that. However that seems > cleaner > and ~30 line shorter. > > Michael, would you comment on that ? The v4 patch and your comments > are here. > https://www.postgresql.org/message-id/attachment/105574/v4-0001-Allow-REINDEX-and-REINDEX-CONCURRENTLY-to-change-tablespace.patch > https://www.postgresql.org/message-id/20191127035416.GG5435%40paquier.xyz > Actually, the last time we discussed this point I only got the gut feeling that this is a subtle place and it is very easy to break things with these changes. However, it isn't clear for me how exactly. That way, I'd be glad if Michael could reword his explanation, so it'd more clear for me as well. BTW, I've started doing a review of the last patch set yesterday and will try to post some comments later. Regards -- Alexey Kondratov Postgres Professional https://www.postgrespro.com Russian Postgres Company
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