pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix crash when a page was split during GiST index creation. 2+ messages / 1 participants [nested] [flat]
* pgsql: Fix crash when a page was split during GiST index creation. @ 2019-12-13 22:03 Heikki Linnakangas <heikki.linnakangas@iki.fi> 0 siblings, 0 replies; 2+ messages in thread From: Heikki Linnakangas @ 2019-12-13 22:03 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix crash when a page was split during GiST index creation. The bug was similar to the one that was fixed in commit 22251686f0. When we split page X and insert the downlink for the new page, the parent page might also need to be split. When that happens, the downlink offset number we remembered for X is no longer valid. We correctly called gistFindCorrectParent() to re-find it, but gistFindCorrectParent() doesn't do anything if the LSN of the page hasn't changed, and we stopped updating LSNs during index build in commit 9155580fd5. The buggy codepath was taken if the page was split into three or more pages, and inserting the downlink caused the parent page to split. To fix, explicitly mark the downlink offset number as invalid, to force gistFindCorrectParent() to re-find it. Fixes bug #16134 reported by Alexander Lakhin, reported again as #16162 by Andreas Kunert. Thanks to Jeff Janes, Tom Lane and Tomas Vondra for debugging. Backpatch to v12, where we stopped WAL-logging during index build. Discussion: https://www.postgresql.org/message-id/16134-0423f729671dec64%40postgresql.org Discussion: https://www.postgresql.org/message-id/16162-45d21b7b6c1a3105%40postgresql.org Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/70c4f500eaeb2ccc3ed49764ee925482bd5c33e0 Modified Files -------------- src/backend/access/gist/gist.c | 1 + 1 file changed, 1 insertion(+) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Fix crash when a page was split during GiST index creation. @ 2019-12-13 22:03 Heikki Linnakangas <heikki.linnakangas@iki.fi> 0 siblings, 0 replies; 2+ messages in thread From: Heikki Linnakangas @ 2019-12-13 22:03 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix crash when a page was split during GiST index creation. The bug was similar to the one that was fixed in commit 22251686f0. When we split page X and insert the downlink for the new page, the parent page might also need to be split. When that happens, the downlink offset number we remembered for X is no longer valid. We correctly called gistFindCorrectParent() to re-find it, but gistFindCorrectParent() doesn't do anything if the LSN of the page hasn't changed, and we stopped updating LSNs during index build in commit 9155580fd5. The buggy codepath was taken if the page was split into three or more pages, and inserting the downlink caused the parent page to split. To fix, explicitly mark the downlink offset number as invalid, to force gistFindCorrectParent() to re-find it. Fixes bug #16134 reported by Alexander Lakhin, reported again as #16162 by Andreas Kunert. Thanks to Jeff Janes, Tom Lane and Tomas Vondra for debugging. Backpatch to v12, where we stopped WAL-logging during index build. Discussion: https://www.postgresql.org/message-id/16134-0423f729671dec64%40postgresql.org Discussion: https://www.postgresql.org/message-id/16162-45d21b7b6c1a3105%40postgresql.org Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/a7ee7c85132221ff7231b6f910915a1b3ce1ecbc Modified Files -------------- src/backend/access/gist/gist.c | 1 + 1 file changed, 1 insertion(+) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2019-12-13 22:03 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2019-12-13 22:03 pgsql: Fix crash when a page was split during GiST index creation. Heikki Linnakangas <heikki.linnakangas@iki.fi> 2019-12-13 22:03 pgsql: Fix crash when a page was split during GiST index creation. Heikki Linnakangas <heikki.linnakangas@iki.fi>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox