]> granicus.if.org Git - postgresql/commit
Fix BRIN summarization concurrent with extension
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Fri, 3 Nov 2017 16:23:13 +0000 (17:23 +0100)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Fri, 3 Nov 2017 16:23:13 +0000 (17:23 +0100)
commitbd8e2b3cf4cfe5f26ed314af662ef988b4cfad4b
treef3c33b98c57c5508657132d597a09333f50ca3ab
parent6cf68e223643203494292c2787b72a7353264c7d
Fix BRIN summarization concurrent with extension

If a process is extending a table concurrently with some BRIN
summarization process, it is possible for the latter to miss pages added
by the former because the number of pages is computed ahead of time.

Fix by determining a fresh relation size after inserting the placeholder
tuple: any process that further extends the table concurrently will
update the placeholder tuple, while previous pages will be processed by
the heap scan.

Reported-by: Tomas Vondra
Reviewed-by: Tom Lane
Author: Álvaro Herrera
Discussion: https://postgr.es/m/083d996a-4a8a-0e13-800a-851dd09ad8cc@2ndquadrant.com
Backpatch-to: 9.5
src/backend/access/brin/brin.c