Re: [HACKERS] [PATCH] Assert that the correct locks are held when calling PageGetLSN()

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Asim Praveen <apraveen(at)pivotal(dot)io>, Jacob Champion <pchampion(at)pivotal(dot)io>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>, Kevin Grittner <kgrittn(at)gmail(dot)com>
Subject: Re: [HACKERS] [PATCH] Assert that the correct locks are held when calling PageGetLSN()
Date: 2018-01-09 20:15:16
Message-ID: 20180109201516.cmpfsdvds4q7zubd@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Pushed 0001.

I confirm the finding that 0002 makes TestForOldSnapshot blow up. I
suppose the right fix is to pass the buffer, not just the page, rather
than trying to reverse-engineer the buffer from the page.

Regarding adding the proposed checks, which I think we should clearly
do, my preferred fix would be to split PageGetLSN in two: one that is
applied to shared buffers, which always runs the assertion, which
retains the current name, and another that is applied to other buffers,
which never does but it does check that the page is not in
shared_buffers and uses another name.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2018-01-09 20:19:00 Re: [HACKERS] [PATCH] Assert that the correct locks are held when calling PageGetLSN()
Previous Message Fabien COELHO 2018-01-09 20:11:26 Re: General purpose hashing func in pgbench