aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2012-11-18 17:15:11 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2012-11-18 17:15:11 -0500
commit83d48a81f8e25f16a133f56874f1bcdee7838841 (patch)
treee14c50411e3e8f05abff9c4a79b8696da9a846ec /src
parent89067bc16a1d1ea5bf131b3529e01d208f2e34c0 (diff)
downloadpostgresql-83d48a81f8e25f16a133f56874f1bcdee7838841.tar.gz
postgresql-83d48a81f8e25f16a133f56874f1bcdee7838841.zip
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.
Diffstat (limited to 'src')
-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 29dac8e0fe6..c37c1d9a5fb 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -1465,7 +1465,7 @@ static struct config_int ConfigureNamesInt[] =
GUC_UNIT_S
},
&XLogArchiveTimeout,
- 0, 0, INT_MAX,
+ 0, 0, INT_MAX / 2,
NULL, NULL, NULL
},
{
@@ -1475,7 +1475,7 @@ static struct config_int ConfigureNamesInt[] =
GUC_NOT_IN_SAMPLE | GUC_UNIT_S
},
&PostAuthDelay,
- 0, 0, INT_MAX,
+ 0, 0, INT_MAX / 1000000,
NULL, NULL, NULL
},
{