summaryrefslogtreecommitdiff
path: root/src/include/postmaster
diff options
context:
space:
mode:
authorTom Lane2016-09-23 13:54:11 +0000
committerTom Lane2016-09-23 13:54:11 +0000
commitb251379fb44b4893624999f1ba00986c029f11cf (patch)
tree15f1c0f1a6383add79fe76487a9c75b5b8402bb3 /src/include/postmaster
parenta88fe25f50ae9ce491fe10a90aeef2cbed6f2b9a (diff)
Avoid using PostmasterRandom() for DSM control segment ID.
Commits 470d886c3 et al intended to fix the problem that the postmaster selected the same "random" DSM control segment ID on every start. But using PostmasterRandom() for that destroys the intended property that the delay between random_start_time and random_stop_time will be unpredictable. (Said delay is probably already more predictable than we could wish, but that doesn't mean that reducing it by a couple orders of magnitude is OK.) Revert the previous patch and add a comment warning against misuse of PostmasterRandom. Fix the original problem by calling srandom() early in PostmasterMain, using a low-security seed that will later be overwritten by PostmasterRandom. Discussion: <20789.1474390434@sss.pgh.pa.us>
Diffstat (limited to 'src/include/postmaster')
-rw-r--r--src/include/postmaster/postmaster.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/include/postmaster/postmaster.h b/src/include/postmaster/postmaster.h
index ef06d5d04c4..b2d7776f2a8 100644
--- a/src/include/postmaster/postmaster.h
+++ b/src/include/postmaster/postmaster.h
@@ -48,7 +48,6 @@ extern const char *progname;
extern void PostmasterMain(int argc, char *argv[]) pg_attribute_noreturn();
extern void ClosePostmasterPorts(bool am_syslogger);
-extern long PostmasterRandom(void);
extern int MaxLivePostmasterChildren(void);