-
Notifications
You must be signed in to change notification settings - Fork 12
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
base: REL_16_STABLE_neon
Are you sure you want to change the base?
Conversation
0bb232c
to
b47180d
Compare
ereport(FATAL, | ||
ereport(recoveryPauseOnMisconfig ? FATAL : WARNING, | ||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), | ||
errmsg("recovery aborted because of insufficient parameter settings"), |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
?
…t replica have smaller value than on primary
b47180d
to
e6e8408
Compare
if (!recoveryPauseOnMisconfig) | ||
if (!allowReplicaMisconfig) | ||
{ | ||
/* Сontinue replication even though it can cause problerms later */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/* С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; |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be
if (!allowReplicaMisconfig) | |
if (allowReplicaMisconfig) |
See neondatabase/neon#9023