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

Commit3e383f9

Browse files
committed
Avoid trying to write an empty WAL record in log_newpage_range().
If the last few pages in the specified range are empty (all zero),then log_newpage_range() could try to emit an empty WAL recordcontaining no FPIs. This at least upsets an Assert inReserveXLogInsertLocation, and might perhaps have bad real-worldconsequences in non-assert builds.This has been broken since log_newpage_range() was introduced,but the case was hard if not impossible to hit before commit3d6a984decided it was okay to leave VM and FSM pages intentionally zero.Nonetheless, it seems prudent to back-patch. log_newpage_range()was added in v12 but later back-patched, so this affects allsupported branches.Matthias van de Meent, per report from Justin PryzbyDiscussion:https://postgr.es/m/ZD1daibg4RF50IOj@telsasoft.com
1 parentcd7cdc5 commit3e383f9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,6 +1304,10 @@ log_newpage_range(Relation rel, ForkNumber forknum,
13041304
blkno++;
13051305
}
13061306

1307+
/* Nothing more to do if all remaining blocks were empty. */
1308+
if (nbufs==0)
1309+
break;
1310+
13071311
/* Write WAL record for this batch. */
13081312
XLogBeginInsert();
13091313

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp