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

Commit8256d7a

Browse files
author
Amit Kapila
committed
Fix assertion failure when updating full_page_writes for checkpointer.
When the checkpointer receives a SIGHUP signal to update its configuration,it may need to update the shared memory for full_page_writes and need towrite a WAL record for it. Now, it is quite possible that the XLOGmachinery has not been initialized by that time and it will lead toassertion failure while doing that. Fix is to allow the initialization ofthe XLOG machinery outside critical section.This bug has been introduced by the commit2c03216 which added the XLOGmachinery initialization in RecoveryInProgress code path.Reported-by: Dilip KumarAuthor: Dilip KumarReviewed-by: Michael Paquier and Amit KapilaBackpatch-through: 9.5Discussion:https://postgr.es/m/CAFiTN-u4BA8KXcQUWDPNgaKAjDXC=C2whnzBM8TAcv=stckYUw@mail.gmail.com
1 parent05b9c58 commit8256d7a

File tree

1 file changed

+9
-1
lines changed
  • src/backend/access/transam

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9601,6 +9601,7 @@ void
96019601
UpdateFullPageWrites(void)
96029602
{
96039603
XLogCtlInsert*Insert=&XLogCtl->Insert;
9604+
boolrecoveryInProgress;
96049605

96059606
/*
96069607
* Do nothing if full_page_writes has not been changed.
@@ -9612,6 +9613,13 @@ UpdateFullPageWrites(void)
96129613
if (fullPageWrites==Insert->fullPageWrites)
96139614
return;
96149615

9616+
/*
9617+
* Perform this outside critical section so that the WAL insert
9618+
* initialization done by RecoveryInProgress() doesn't trigger an
9619+
* assertion failure.
9620+
*/
9621+
recoveryInProgress=RecoveryInProgress();
9622+
96159623
START_CRIT_SECTION();
96169624

96179625
/*
@@ -9632,7 +9640,7 @@ UpdateFullPageWrites(void)
96329640
* Write an XLOG_FPW_CHANGE record. This allows us to keep track of
96339641
* full_page_writes during archive recovery, if required.
96349642
*/
9635-
if (XLogStandbyInfoActive()&& !RecoveryInProgress())
9643+
if (XLogStandbyInfoActive()&& !recoveryInProgress)
96369644
{
96379645
XLogBeginInsert();
96389646
XLogRegisterData((char*) (&fullPageWrites),sizeof(bool));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp