Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3b4e53a

Browse files
committed
Add infrastructure for efficient LSN waiting
Implement a new facility that allows processes to wait for WAL to reachspecific LSNs, both on primary (waiting for flush) and standby (waitingfor replay) servers.The implementation uses shared memory with per-backend informationorganized into pairing heaps, allowing O(1) access to the minimumwaited LSN. This enables fast-path checks: after replaying or flushingWAL, the startup process or WAL writer can quickly determine if anywaiters need to be awakened.Key components:- New xlogwait.c/h module with WaitForLSNReplay() and WaitForLSNFlush()- Separate pairing heaps for replay and flush waiters- WaitLSN lightweight lock for coordinating shared state- Wait events WAIT_FOR_WAL_REPLAY and WAIT_FOR_WAL_FLUSH for monitoringThis infrastructure can be used by features that need to wait for WALoperations to complete.Discussion:https://www.postgresql.org/message-id/flat/CAPpHfdsjtZLVzxjGT8rJHCYbM0D5dwkO+BBjcirozJ6nYbOW8Q@mail.gmail.comDiscussion:https://www.postgresql.org/message-id/flat/CABPTF7UNft368x-RgOXkfj475OwEbp%2BVVO-wEXz7StgjD_%3D6sw%40mail.gmail.comAuthor: Kartyshov Ivan <i.kartyshov@postgrespro.ru>Author: Alexander Korotkov <aekorotkov@gmail.com>Author: Xuneng Zhou <xunengzhou@gmail.com>Reviewed-by: Michael Paquier <michael@paquier.xyz>Reviewed-by: Peter Eisentraut <peter.eisentraut@enterprisedb.com>Reviewed-by: Dilip Kumar <dilipbalaut@gmail.com>Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>Reviewed-by: Alexander Lakhin <exclusion@gmail.com>Reviewed-by: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>Reviewed-by: Euler Taveira <euler@eulerto.com>Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com>Reviewed-by: Xuneng Zhou <xunengzhou@gmail.com>
1 parent8af3ae0 commit3b4e53a

File tree

8 files changed

+521
-1
lines changed

8 files changed

+521
-1
lines changed

‎src/backend/access/transam/Makefile‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ OBJS = \
3636
xlogreader.o\
3737
xlogrecovery.o\
3838
xlogstats.o\
39-
xlogutils.o
39+
xlogutils.o\
40+
xlogwait.o
4041

4142
include$(top_srcdir)/src/backend/common.mk
4243

‎src/backend/access/transam/meson.build‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ backend_sources += files(
2424
'xlogrecovery.c',
2525
'xlogstats.c',
2626
'xlogutils.c',
27+
'xlogwait.c',
2728
)
2829

2930
# used by frontend programs to build a frontend xlogreader

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp