pgsql: Harden nbtree deduplication posting split code.

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема pgsql: Harden nbtree deduplication posting split code.
Дата
Msg-id E1lhfzL-0001cu-47@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Harden nbtree deduplication posting split code.

Add a defensive "can't happen" error to code that handles nbtree posting
list splits (promote an existing assertion).  This avoids a segfault in
the event of an insertion of a newitem that is somehow identical to an
existing non-pivot tuple in the index.  An nbtree index should never
have two index tuples with identical TIDs.

This scenario is not particular unlikely in the event of any kind of
corruption that leaves the index in an inconsistent state relative to
the heap relation that is indexed.  There are two known reports of
preventable hard crashes.  Doing nothing seems unacceptable given the
general expectation that nbtree will cope reasonably well with corrupt
data.

Discussion: https://postgr.es/m/CAH2-Wz=Jr_d-dOYEEmwz0-ifojVNWho01eAqewfQXgKfoe114w@mail.gmail.com
Backpatch: 13-, where nbtree deduplication was introduced.

Branch
------
REL_13_STABLE

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

Modified Files
--------------
src/backend/access/nbtree/nbtdedup.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Doc: correct erroneous entry in this week's minor release notes.
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Be more careful about barriers when releasing BackgroundWorkerSl