We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 77b68e3 commit 84d4de9Copy full SHA for 84d4de9
src/bin/pg_checksums/pg_checksums.c
@@ -475,7 +475,7 @@ main(int argc, char *argv[])
475
exit(1);
476
}
477
478
- /* Check if cluster is running */
+ /* Read the control file and check compatibility */
479
ControlFile = get_controlfile(DataDir, &crc_ok);
480
if (!crc_ok)
481
{
@@ -497,6 +497,11 @@ main(int argc, char *argv[])
497
498
499
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
+ */
505
if (ControlFile->state != DB_SHUTDOWNED &&
506
ControlFile->state != DB_SHUTDOWNED_IN_RECOVERY)
507
0 commit comments