Remove useless arguments in ReadCheckpointRecord().
authorFujii Masao <[email protected]>
Wed, 20 Jul 2022 14:06:44 +0000 (23:06 +0900)
committerFujii Masao <[email protected]>
Mon, 25 Jul 2022 01:59:38 +0000 (10:59 +0900)
commit2387f52962e615eac937ed47de724e4d55ffffb7
treef6296f438ec8fc190c16afa0b6d8d45820a90543
parent6955bba0ede45e9379d04d7faaa889448919aa07
Remove useless arguments in ReadCheckpointRecord().

This commit removes two arguments "report" and "whichChkpt"
in ReadCheckpointRecord().

"report" is obviously useless because it's always true, i.e., there are
two callers of the function and they always specify true as "report".
Commit 1d919de5eb removed the only call with "report" = false.

"whichChkpt" indicated where the specified checkpoint location
came from, pg_control or backup_label. This information was used
to report different error messages depending on where the invalid
checkpoint record came from, when it was found.
But ReadCheckpointRecord() doesn't need to do that because
its callers already do that and users can still identify where
the invalid checkpoint record came from, by reading such log messages.
Also when "whichChkpt" was 0, the word "primary checkpoint" was used
in the log message and could confuse users because the concept of
primary and secondary checkpoints was already removed before.
These are why this commit removes "whichChkpt" argument.

Author: Fujii Masao
Reviewed-by: Bharath Rupireddy, Kyotaro Horiguchi
Discussion: https://postgr.es/m/fa2e12eb-81c3-0717-0272-755f8a81c8f2@oss.nttdata.com
src/backend/access/transam/xlogrecovery.c