pgsql: Fix creation of partition descriptor during concurrent detach

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема pgsql: Fix creation of partition descriptor during concurrent detach
Дата
Msg-id E1sGyBE-000zsI-6R@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix creation of partition descriptor during concurrent detach

When a partition is being detached in concurrent mode, it is possible
for find_inheritance_children_extended() to return that partition in the
list, and immediately after that receive an invalidation message that
sets its relpartbound to NULL just before we read it.  (This can happen
because table_open() reads invalidation messages.)  Currently we raise
an error
  ERROR:  missing relpartbound for relation %u
about the situation, but that's bogus because the table is no longer a
partition, so we shouldn't be complaining about it.  A better reaction
is to retry the find_inheritance_children_extended call to get a new
list, which will no longer have the partition being detached.

Noticed while investigating bug #18377.

Backpatch to 14, where DETACH CONCURRENTLY appeared.

Discussion: https://postgr.es/m/202405201616.y4ht2qe5ihoy@alvherre.pgsql

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/03c8cdbb7e75669322d3084dfc918b721c77f076

Modified Files
--------------
src/backend/partitioning/partdesc.c | 53 ++++++++++++++++++++++++++++---------
1 file changed, 40 insertions(+), 13 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Amit Kapila
Дата:
Сообщение: pgsql: Fix an assert in CheckPointReplicationSlots().
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix infer_arbiter_indexes() to not assume resultRelation is 1.