1
0
mirror of https://github.com/postgres/postgres.git synced 2026-10-28 02:33:10 +03:00
Files
postgres/src/backend
Andres Freund c0af4eb4e7 bufmgr: Fix ordering of checks in PinBuffer()
The check for skip_if_not_valid added in 819dc118c0 was put at the start of
the loop. A CAS loop in theory does allow to make that check in a race free
manner. However, just after the check, there's a
    old_buf_state = WaitBufHdrUnlocked(buf);
which introduces a race, because it would allow BM_VALID to be cleared, after
the skip_if_not_valid check.

Fix by restarting the loop after WaitBufHdrUnlocked().

Reported-by: Yura Sokolov <y.sokolov@postgrespro.ru>
Discussion: https://postgr.es/m/5bf667f3-5270-4b19-a08f-0facbecdff68@postgrespro.ru
2026-03-31 19:24:58 -04:00
..
2026-03-30 16:12:08 -05:00
2026-03-30 16:12:08 -05:00
2026-01-01 13:24:10 -05:00
2026-03-30 16:12:08 -05:00
2026-01-01 13:24:10 -05:00
…
2026-03-18 12:37:11 +01:00