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