Re: Buffer locking is special (hints, checksums, AIO writes) - Mailing list pgsql-hackers

From cca5507
Subject Re: Buffer locking is special (hints, checksums, AIO writes)
Date
Msg-id tencent_CFA13385DEB545296F328E7897074D76DC08@qq.com
Whole thread Raw
In response to Re: Buffer locking is special (hints, checksums, AIO writes)  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Hi,

I find some outdated comments in src/backend/storage/buffer/README:

```
Note that a buffer header's spinlock does not control access to the data
held within the buffer.  Each buffer header also contains an LWLock, the
"buffer content lock", that *does* represent the right to access the data
in the buffer.  It is used per the rules above.
```

"Each buffer header also contains an LWLock" is outdated.

```
The background writer takes shared content lock on a buffer while writing it
out (and anyone else who flushes buffer contents to disk must do so too).
This ensures that the page image transferred to disk is reasonably consistent.
We might miss a hint-bit update or two but that isn't a problem, for the same
reasons mentioned under buffer access rules.
```

"The background writer takes shared content lock ...", should be "share-exclusive content lock".

"We might miss a hint-bit update or two ...", maybe already fixed by share-exclusive content lock?

--
Regards,
ChangAo Chen

pgsql-hackers by date:

Previous
From: Florents Tselai
Date:
Subject: Re: Patch: Add tsmatch JSONPath operator for granular Full Text Search
Next
From: Daniel Gustafsson
Date:
Subject: Re: Flaky test in t/100_vacuumdb.pl: ordering assumption not stable under plan changes