summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2012-11-18 17:15:32 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2012-11-18 17:15:32 -0500
commit8728fdce97e2012cb3715ddc294ab9e54967ef7c (patch)
tree9f26f5f0d36e0f964a7de899c4c98853c08bc456
parent46c79df29e5fafdec1569ad217890809df068c24 (diff)
downloadpostgresql-8728fdce97e2012cb3715ddc294ab9e54967ef7c.tar.gz
Limit values of archive_timeout, post_auth_delay, auth_delay.milliseconds.
The previous definitions of these GUC variables allowed them to range up to INT_MAX, but in point of fact the underlying code would suffer overflows or other errors with large values. Reduce the maximum values to something that won't misbehave. There's no apparent value in working harder than this, since very large delays aren't sensible for any of these. (Note: the risk with archive_timeout is that if we're late checking the state, the timestamp difference it's being compared to might overflow. So we need some amount of slop; the choice of INT_MAX/2 is arbitrary.) Per followup investigation of bug #7670. Although this isn't a very significant fix, might as well back-patch.
-rw-r--r--src/backend/utils/misc/guc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index 38dc8a95d5..cd3c933a33 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -1110,7 +1110,7 @@ static struct config_int ConfigureNamesInt[] =
GUC_UNIT_S
},
&XLogArchiveTimeout,
- 0, 0, INT_MAX, NULL, NULL
+ 0, 0, INT_MAX / 2, NULL, NULL
},
{
{"post_auth_delay", PGC_BACKEND, DEVELOPER_OPTIONS,
@@ -1119,7 +1119,7 @@ static struct config_int ConfigureNamesInt[] =
GUC_NOT_IN_SAMPLE | GUC_UNIT_S
},
&PostAuthDelay,
- 0, 0, INT_MAX, NULL, NULL
+ 0, 0, INT_MAX / 1000000, NULL, NULL
},
{
{"default_statistics_target", PGC_USERSET, QUERY_TUNING_OTHER,