mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Replace buffer I/O locks with condition variables.
1. Backends waiting for buffer I/O are now interruptible. 2. If something goes wrong in a backend that is currently performing I/O, waiting backends no longer wake up until that backend reaches AbortBufferIO() and broadcasts on the CV. Previously, any waiters would wake up (because the I/O lock was automatically released) and then busy-loop until AbortBufferIO() cleared BM_IO_IN_PROGRESS. 3. LWLockMinimallyPadded is removed, as it would now be unused. Author: Robert Haas <robertmhaas@gmail.com> Reviewed-by: Thomas Munro <thomas.munro@gmail.com> Reviewed-by: Julien Rouhaud <rjuju123@gmail.com> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> (earlier version, 2016) Discussion: https://postgr.es/m/CA%2BhUKGJ8nBFrjLuCTuqKN0pd2PQOwj9b_jnsiGFFMDvUxahj_A%40mail.gmail.com Discussion: https://postgr.es/m/CA+Tgmoaj2aPti0yho7FeEf2qt-JgQPRWb0gci_o1Hfr=C56Xng@mail.gmail.com
This commit is contained in:
@@ -146,8 +146,6 @@ static const char *const BuiltinTrancheNames[] = {
|
||||
"WALInsert",
|
||||
/* LWTRANCHE_BUFFER_CONTENT: */
|
||||
"BufferContent",
|
||||
/* LWTRANCHE_BUFFER_IO: */
|
||||
"BufferIO",
|
||||
/* LWTRANCHE_REPLICATION_ORIGIN_STATE: */
|
||||
"ReplicationOriginState",
|
||||
/* LWTRANCHE_REPLICATION_SLOT_IO: */
|
||||
@@ -469,8 +467,7 @@ CreateLWLocks(void)
|
||||
StaticAssertStmt(LW_VAL_EXCLUSIVE > (uint32) MAX_BACKENDS,
|
||||
"MAX_BACKENDS too big for lwlock.c");
|
||||
|
||||
StaticAssertStmt(sizeof(LWLock) <= LWLOCK_MINIMAL_SIZE &&
|
||||
sizeof(LWLock) <= LWLOCK_PADDED_SIZE,
|
||||
StaticAssertStmt(sizeof(LWLock) <= LWLOCK_PADDED_SIZE,
|
||||
"Miscalculated LWLock padding");
|
||||
|
||||
if (!IsUnderPostmaster)
|
||||
|
Reference in New Issue
Block a user