Re: crash-safe visibility map, take four - Mailing list pgsql-hackers

From 高增琦
Subject Re: crash-safe visibility map, take four
Date
Msg-id AANLkTikBWi-a2eNPBK=VfLDQdOunq7hsFeVwLZpimJ8W@mail.gmail.com
Whole thread Raw
In response to Re: crash-safe visibility map, take four  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
2011/3/30 Robert Haas <robertmhaas@gmail.com>
Maybe we could check PD_ALL_VISIBLE before
taking the buffer lock - if it appears to be set, then we pin the
visibility map page before taking the buffer lock.  Otherwise, we take
the buffer lock at once.  Either way, once we have the lock, we
recheck the bit.  Only if it's set and we haven't got a pin do we need
to do the drop-lock-pin-reacquire-lock dance.  Is that at all
sensible?

But only lock can make sure the page has enough free space.
If we try the drop-lock-...-lock dance, we may fall into a dead loop.

--
GaoZengqi
pgf00a@gmail.com
zengqigao@gmail.com

pgsql-hackers by date:

Previous
From: 高增琦
Date:
Subject: Re: crash-safe visibility map, take four
Next
From: Jan Urbański
Date:
Subject: Re: Re: [COMMITTERS] pgsql: Fix plpgsql to release SPI plans when a function or DO block is