Re: fix oversight converting buf_id to Buffer

From: Andres Freund <andres(at)anarazel(dot)de>
To: Qingqing Zhou <zhouqq(dot)postgres(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: fix oversight converting buf_id to Buffer
Date: 2015-08-10 23:15:37
Message-ID: 20150810231537.GA22153@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

That's a very nice catch! Did you trigger the error or just found it
when reading the code?

On 2015-08-10 12:12:01 -0700, Qingqing Zhou wrote:
> Attached patch fixes oversights converting buf_id to Buffer in
> PrintBufferDescs() and InvalidateBuffer(). Especially for the latter,
> the reason we haven't seen any reports of the issue might be that it
> needs certain concurrent conditions to be true.

PrintBufferDescs() is dead code, so bit is not surprising. I'm also not
surprised that the wrong buffer in InvalidateBuffer()'s check doesn't
trigger. You'd have to have a cursor open in the current backend that
currently pins the off-by-one buffer.

I'm too tired right now to look at this, but it generally looked sane.

Regards,

Andres

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-08-10 23:29:04 Re: [COMMITTERS] pgsql: Fix pg_dump to dump shell types.
Previous Message David Fetter 2015-08-10 23:03:36 Re: [patch] A \pivot command for psql