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

Commitc55de5e

Browse files
committed
Add wait event for fsync of WAL segments
This has been visibly a forgotten spot in the first implementation ofwait events for I/O added by249cf07, and what has been missing is afsync call for WAL segments which is a wrapper reacting on the value ofGUC wal_sync_method.Reported-by: Konstantin KnizhnikAuthor: Konstantin KnizhnikReviewed-by: Craig Ringer, Michael PaquierDiscussion:https://postgr.es/m/4a243897-0ad8-f471-aa40-242591f2476e@postgrespro.ru
1 parentc072e80 commitc55de5e

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

‎doc/src/sgml/monitoring.sgml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1674,6 +1674,10 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
16741674
<entry><literal>WALSenderTimelineHistoryRead</literal></entry>
16751675
<entry>Waiting for a read from a timeline history file during walsender timeline command.</entry>
16761676
</row>
1677+
<row>
1678+
<entry><literal>WALSync</literal></entry>
1679+
<entry>Waiting for a WAL file to reach stable storage.</entry>
1680+
</row>
16771681
<row>
16781682
<entry><literal>WALSyncMethodAssign</literal></entry>
16791683
<entry>Waiting for data to reach stable storage while assigning WAL sync method.</entry>

‎src/backend/access/transam/xlog.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10156,6 +10156,7 @@ assign_xlog_sync_method(int new_sync_method, void *extra)
1015610156
void
1015710157
issue_xlog_fsync(intfd,XLogSegNosegno)
1015810158
{
10159+
pgstat_report_wait_start(WAIT_EVENT_WAL_SYNC);
1015910160
switch (sync_method)
1016010161
{
1016110162
caseSYNC_METHOD_FSYNC:
@@ -10191,6 +10192,7 @@ issue_xlog_fsync(int fd, XLogSegNo segno)
1019110192
elog(PANIC,"unrecognized wal_sync_method: %d",sync_method);
1019210193
break;
1019310194
}
10195+
pgstat_report_wait_end();
1019410196
}
1019510197

1019610198
/*

‎src/backend/postmaster/pgstat.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3925,6 +3925,9 @@ pgstat_get_wait_io(WaitEventIO w)
39253925
caseWAIT_EVENT_WAL_READ:
39263926
event_name="WALRead";
39273927
break;
3928+
caseWAIT_EVENT_WAL_SYNC:
3929+
event_name="WALSync";
3930+
break;
39283931
caseWAIT_EVENT_WAL_SYNC_METHOD_ASSIGN:
39293932
event_name="WALSyncMethodAssign";
39303933
break;

‎src/include/pgstat.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -921,6 +921,7 @@ typedef enum
921921
WAIT_EVENT_WAL_INIT_SYNC,
922922
WAIT_EVENT_WAL_INIT_WRITE,
923923
WAIT_EVENT_WAL_READ,
924+
WAIT_EVENT_WAL_SYNC,
924925
WAIT_EVENT_WAL_SYNC_METHOD_ASSIGN,
925926
WAIT_EVENT_WAL_WRITE
926927
}WaitEventIO;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp