Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GUC controlling whether to pause recovery if some critical GUCs at replica have smaller value than on primary #501

Open
wants to merge 3 commits into
base: REL_16_STABLE_neon
Choose a base branch
from

Conversation

knizhnik
Copy link

src/backend/utils/misc/guc_tables.c Outdated Show resolved Hide resolved
src/backend/access/transam/xlogrecovery.c Outdated Show resolved Hide resolved
@knizhnik knizhnik force-pushed the pause_recovery_at_misconfig_v16 branch from 0bb232c to b47180d Compare September 23, 2024 15:51
Comment on lines 4860 to 4866
ereport(FATAL,
ereport(recoveryPauseOnMisconfig ? FATAL : WARNING,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("recovery aborted because of insufficient parameter settings"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is misleading. You print a WARNING that says "recovery aborted", but it is not aborted.

The GUC name is misleading too: if it's 'on', you abort rather than pause here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeh, I tried to minimise changed... Will replace the message.
Can you suggest some better name for the GUC? allow_replica_misconfig ?

@knizhnik knizhnik force-pushed the pause_recovery_at_misconfig_v16 branch from b47180d to e6e8408 Compare November 13, 2024 17:07
if (!recoveryPauseOnMisconfig)
if (!allowReplicaMisconfig)
{
/* Сontinue replication even though it can cause problerms later */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/* Сontinue replication even though it can cause problerms later */
/* Сontinue replication even though it can cause problems later */

@@ -91,6 +91,7 @@ TimestampTz recoveryTargetTime;
const char *recoveryTargetName;
XLogRecPtr recoveryTargetLSN;
int recovery_min_apply_delay = 0;
bool allowReplicaMisconfig = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where's the GUC for this defined? It was in guc_tables.c in an earlier version of this PR but I don't see it anymore. Is it in the neon extension perhaps? If so, let's add a comment here pointing that out.

@@ -4809,6 +4810,12 @@ RecoveryRequiresIntParameter(const char *param_name, int currValue, int minValue
currValue,
minValue)));

if (!allowReplicaMisconfig)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be

Suggested change
if (!allowReplicaMisconfig)
if (allowReplicaMisconfig)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants