mirror of
https://github.com/postgres/postgres.git
synced 2025-11-18 02:02:55 +03:00
Get rid of WALBufMappingLock
Allow multiple backends to initialize WAL buffers concurrently. This way `MemSet((char *) NewPage, 0, XLOG_BLCKSZ);` can run in parallel without taking a single LWLock in exclusive mode. The new algorithm works as follows: * reserve a page for initialization using XLogCtl->InitializeReserved, * ensure the page is written out, * once the page is initialized, try to advance XLogCtl->InitializedUpTo and signal to waiters using XLogCtl->InitializedUpToCondVar condition variable, * repeat previous steps until we reserve initialization up to the target WAL position, * wait until concurrent initialization finishes using a XLogCtl->InitializedUpToCondVar. Now, multiple backends can, in parallel, concurrently reserve pages, initialize them, and advance XLogCtl->InitializedUpTo to point to the latest initialized page. Author: Yura Sokolov <y.sokolov@postgrespro.ru> Co-authored-by: Alexander Korotkov <aekorotkov@gmail.com> Reviewed-by: Pavel Borisov <pashkin.elfe@gmail.com>
This commit is contained in:
@@ -155,6 +155,7 @@ REPLICATION_SLOT_DROP "Waiting for a replication slot to become inactive so it c
|
||||
RESTORE_COMMAND "Waiting for <xref linkend="guc-restore-command"/> to complete."
|
||||
SAFE_SNAPSHOT "Waiting to obtain a valid snapshot for a <literal>READ ONLY DEFERRABLE</literal> transaction."
|
||||
SYNC_REP "Waiting for confirmation from a remote server during synchronous replication."
|
||||
WAL_BUFFER_INIT "Waiting on WAL buffer to be initialized."
|
||||
WAL_RECEIVER_EXIT "Waiting for the WAL receiver to exit."
|
||||
WAL_RECEIVER_WAIT_START "Waiting for startup process to send initial data for streaming replication."
|
||||
WAL_SUMMARY_READY "Waiting for a new WAL summary to be generated."
|
||||
@@ -310,7 +311,6 @@ XidGen "Waiting to allocate a new transaction ID."
|
||||
ProcArray "Waiting to access the shared per-process data structures (typically, to get a snapshot or report a session's transaction ID)."
|
||||
SInvalRead "Waiting to retrieve messages from the shared catalog invalidation queue."
|
||||
SInvalWrite "Waiting to add a message to the shared catalog invalidation queue."
|
||||
WALBufMapping "Waiting to replace a page in WAL buffers."
|
||||
WALWrite "Waiting for WAL buffers to be written to disk."
|
||||
ControlFile "Waiting to read or update the <filename>pg_control</filename> file or create a new WAL file."
|
||||
MultiXactGen "Waiting to read or update shared multixact state."
|
||||
|
||||
Reference in New Issue
Block a user