Re: Parallel Bitmap scans a bit broken

From: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Dilip Kumar <dilipbalaut(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Parallel Bitmap scans a bit broken
Date: 2017-03-09 22:31:23
Message-ID: CAKJS1f_FR5AX5BBivAUR3WEz9a0vvXNHRFrRwFEfeeMVr9YBFA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10 March 2017 at 06:17, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:

> On Thu, Mar 9, 2017 at 11:50 AM, Dilip Kumar <dilipbalaut(at)gmail(dot)com>
> wrote:
> > On Thu, Mar 9, 2017 at 10:02 PM, Dilip Kumar <dilipbalaut(at)gmail(dot)com>
> wrote:
> >> I slightly modified your query to reproduce this issue.
> >>
> >> explain analyze select * from r1 where value<555;
> >>
> >> Patch is attached to fix the problem.
> >
> > I forgot to mention the cause of the problem.
> >
> > if (istate->schunkptr < istate->nchunks)
> > {
> > PagetableEntry *chunk = &ptbase[idxchunks[istate->schunkptr]];
> > PagetableEntry *page = &ptbase[idxpages[istate->spageptr]];
> > BlockNumber chunk_blockno;
> >
> > In above if condition we have only checked istate->schunkptr <
> > istate->nchunks that means we have some chunk left so we are safe to
> > access idxchunks, But just after that we are accessing
> > ptbase[idxpages[istate->spageptr]] without checking that accessing
> > idxpages is safe or not.
> >
> > tbm_iterator already handling this case, I broke it in
> tbm_shared_iterator.
>
> I don't know if this is the only problem -- it would be good if David
> could retest -- but it's certainly *a* problem, so committed.
>

Thanks for committing, and generally parallelising more stuff.

I confirm that my test case is now working again.

I'll be in this general area today, so will mention if I stumble over
anything that looks broken.

--
David Rowley http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Naytro Naytro 2017-03-09 22:38:46 Re: Performance issue after upgrading from 9.4 to 9.6
Previous Message Bruce Momjian 2017-03-09 22:25:51 Re: rename pg_log directory?