]> 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)
commitec42a1dcb30de235b252f6d4972f2f2bdb2e47f2
tree808de82b174f150b1a1b49fd3dc6518cb4c7206e
parent7164991caf3858cbd75e5efb7943e11a51ad04f9
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