pgsql: Refactor nbtree deletion INCOMPLETE_SPLIT check.

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема pgsql: Refactor nbtree deletion INCOMPLETE_SPLIT check.
Дата
Msg-id E1jWpdj-0002OH-B3@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Refactor nbtree deletion INCOMPLETE_SPLIT check.

Factor out code common to _bt_lock_branch_parent() and _bt_pagedel()
into a new utility function.  This new function is used to check that
the left sibling of a deletion target page does not have the
INCOMPLETE_SPLIT page flag set.  If it is set then deletion is unsafe;
there won't be a usable pivot tuple (with a downlink) in the parent page
that points to the deletion target page.  The page deletion algorithm is
not prepared to deal with that.  Also restructure an existing, related
utility function that checks if the right sibling of the target page has
the ISHALFDEAD page flag set.

This organization highlights the symmetry between the two cases.  The
goal is to make the design of page deletion clearer.  Both functions
involve a sibling page with a flag that indicates that there was an
interrupted operation (a page split or a page deletion) that resulted in
a page pointed to by sibling pages, but not pointed to in the parent.
And, both functions indicate if page deletion is unsafe due to the
absence of a particular downlink in the parent page.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/cd8c73a38a23c364e71973d6832a585616d24756

Modified Files
--------------
src/backend/access/nbtree/nbtpage.c | 184 ++++++++++++++++++++----------------
1 file changed, 100 insertions(+), 84 deletions(-)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix YA text phrase search bug.
Следующее
От: Fujii Masao
Дата:
Сообщение: pgsql: Report missing wait event for timeline history file.