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

Commit84d4de9

Browse files
committed
Improve some comments in pg_checksums about the needed clean shutdown
It was not clear from the code why it is necessary. And we need a cleanshutdown to avoid random checksum failures caused by torn pages.Author: Masahiko SawadaDiscussion:https://postgr.es/m/CAD21AoDum5MbAb7F=pa9dOD1W2tukuDMPzWT7NjZceNoWB_6Qw@mail.gmail.com
1 parent77b68e3 commit84d4de9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎src/bin/pg_checksums/pg_checksums.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ main(int argc, char *argv[])
475475
exit(1);
476476
}
477477

478-
/*Check if cluster is running */
478+
/*Read the control file and check compatibility */
479479
ControlFile=get_controlfile(DataDir,&crc_ok);
480480
if (!crc_ok)
481481
{
@@ -497,6 +497,11 @@ main(int argc, char *argv[])
497497
exit(1);
498498
}
499499

500+
/*
501+
* Check if cluster is running. A clean shutdown is required to avoid
502+
* random checksum failures caused by torn pages. Note that this doesn't
503+
* guard against someone starting the cluster concurrently.
504+
*/
500505
if (ControlFile->state!=DB_SHUTDOWNED&&
501506
ControlFile->state!=DB_SHUTDOWNED_IN_RECOVERY)
502507
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp