pgsql: Fix BRIN summarization concurrent with extension

Started by Alvaro Herreraover 8 years ago3 messagescomitters
Jump to latest
#1Alvaro Herrera
alvherre@2ndquadrant.com

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: /messages/by-id/083d996a-4a8a-0e13-800a-851dd09ad8cc@2ndquadrant.com
Backpatch-to: 9.5

Branch
------
master

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

Modified Files
--------------
src/backend/access/brin/brin.c | 90 ++++++++++++++++++++++++++++--------------
1 file changed, 61 insertions(+), 29 deletions(-)

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alvaro Herrera (#1)
Re: pgsql: Fix BRIN summarization concurrent with extension

Alvaro Herrera <alvherre@alvh.no-ip.org> writes:

Fix BRIN summarization concurrent with extension

Buildfarm is entirely unhappy ...

regards, tom lane

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

#3Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Tom Lane (#2)
Re: pgsql: Fix BRIN summarization concurrent with extension

Tom Lane wrote:

Alvaro Herrera <alvherre@alvh.no-ip.org> writes:

Fix BRIN summarization concurrent with extension

Buildfarm is entirely unhappy ...

Will fix shortly.

--
�lvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers