Re: [HACKERS] [PATCH] Assert that the correct locks are held whencalling PageGetLSN() - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: [HACKERS] [PATCH] Assert that the correct locks are held whencalling PageGetLSN()
Date
Msg-id 20180109201516.cmpfsdvds4q7zubd@alvherre.pgsql
Whole thread Raw
In response to Re: [HACKERS] [PATCH] Assert that the correct locks are held whencalling PageGetLSN()  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: [HACKERS] [PATCH] Assert that the correct locks are held whencalling PageGetLSN()
List 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


pgsql-hackers by date:

Previous
From: Fabien COELHO
Date:
Subject: Re: General purpose hashing func in pgbench
Next
From: Alvaro Herrera
Date:
Subject: Re: [HACKERS] [PATCH] Assert that the correct locks are held whencalling PageGetLSN()