pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix bug in detecting concurrent page splits in GiST insert 3+ messages / 1 participants [nested] [flat]
* pgsql: Fix bug in detecting concurrent page splits in GiST insert @ 2021-01-20 09:59 Heikki Linnakangas <heikki.linnakangas@iki.fi> 0 siblings, 0 replies; 3+ messages in thread From: Heikki Linnakangas @ 2021-01-20 09:59 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix bug in detecting concurrent page splits in GiST insert In commit 9eb5607e699, I got the condition on checking for split or deleted page wrong: I used && instead of ||. The comment correctly said "concurrent split _or_ deletion". As a result, GiST insertion could miss a concurrent split, and insert to wrong page. Duncan Sands demonstrated this with a test script that did a lot of concurrent inserts. Backpatch to v12, where this was introduced. REINDEX is required to fix indexes that were affected by this bug. Backpatch-through: 12 Reported-by: Duncan Sands Discussion: https://www.postgresql.org/message-id/a9690483-6c6c-3c82-c8ba-dc1a40848f11%40deepbluecap.com Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/0326635dd484fe1d5272dd0c551b78e3f779acb4 Modified Files -------------- src/backend/access/gist/gist.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Fix bug in detecting concurrent page splits in GiST insert @ 2021-01-20 09:59 Heikki Linnakangas <heikki.linnakangas@iki.fi> 0 siblings, 0 replies; 3+ messages in thread From: Heikki Linnakangas @ 2021-01-20 09:59 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix bug in detecting concurrent page splits in GiST insert In commit 9eb5607e699, I got the condition on checking for split or deleted page wrong: I used && instead of ||. The comment correctly said "concurrent split _or_ deletion". As a result, GiST insertion could miss a concurrent split, and insert to wrong page. Duncan Sands demonstrated this with a test script that did a lot of concurrent inserts. Backpatch to v12, where this was introduced. REINDEX is required to fix indexes that were affected by this bug. Backpatch-through: 12 Reported-by: Duncan Sands Discussion: https://www.postgresql.org/message-id/a9690483-6c6c-3c82-c8ba-dc1a40848f11%40deepbluecap.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/6b4d3046f422c2682365924b515c7588d5a3e651 Modified Files -------------- src/backend/access/gist/gist.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Fix bug in detecting concurrent page splits in GiST insert @ 2021-01-20 09:59 Heikki Linnakangas <heikki.linnakangas@iki.fi> 0 siblings, 0 replies; 3+ messages in thread From: Heikki Linnakangas @ 2021-01-20 09:59 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix bug in detecting concurrent page splits in GiST insert In commit 9eb5607e699, I got the condition on checking for split or deleted page wrong: I used && instead of ||. The comment correctly said "concurrent split _or_ deletion". As a result, GiST insertion could miss a concurrent split, and insert to wrong page. Duncan Sands demonstrated this with a test script that did a lot of concurrent inserts. Backpatch to v12, where this was introduced. REINDEX is required to fix indexes that were affected by this bug. Backpatch-through: 12 Reported-by: Duncan Sands Discussion: https://www.postgresql.org/message-id/a9690483-6c6c-3c82-c8ba-dc1a40848f11%40deepbluecap.com Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/b8403d140f4e7d753d21116c0fa79dc4ca5ca5cb Modified Files -------------- src/backend/access/gist/gist.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2021-01-20 09:59 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2021-01-20 09:59 pgsql: Fix bug in detecting concurrent page splits in GiST insert Heikki Linnakangas <heikki.linnakangas@iki.fi> 2021-01-20 09:59 pgsql: Fix bug in detecting concurrent page splits in GiST insert Heikki Linnakangas <heikki.linnakangas@iki.fi> 2021-01-20 09:59 pgsql: Fix bug in detecting concurrent page splits in GiST insert 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