Skip to content

Commit 6862ca6

Browse files
committed
Fix processing of PGC_BACKEND GUC parameters on Windows.
EXEC_BACKEND builds (i.e., Windows) failed to absorb values of PGC_BACKEND parameters if they'd been changed post-startup via the config file. This for example prevented log_connections from working if it were turned on post-startup. The mechanism for handling this case has always been a bit of a kluge, and it wasn't revisited when we implemented EXEC_BACKEND. While in a normal forking environment new backends will inherit the postmaster's value of such settings, EXEC_BACKEND backends have to read the settings from the CONFIG_EXEC_PARAMS file, and they were mistakenly rejecting them. So this case has always been broken in the Windows port; so back-patch to all supported branches. Amit Kapila
1 parent 44c5d38 commit 6862ca6

File tree

1 file changed

+20
-0
lines changed
  • src/backend/utils/misc

1 file changed

+20
-0
lines changed

src/backend/utils/misc/guc.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5669,9 +5669,23 @@ set_config_option(const char *name, const char *value,
56695669
* ignore it in existing backends. This is a tad klugy, but
56705670
* necessary because we don't re-read the config file during
56715671
* backend start.
5672+
*
5673+
* In EXEC_BACKEND builds, this works differently: we load all
5674+
* nondefault settings from the CONFIG_EXEC_PARAMS file during
5675+
* backend start. In that case we must accept PGC_SIGHUP
5676+
* settings, so as to have the same value as if we'd forked
5677+
* from the postmaster. We detect this situation by checking
5678+
* IsInitProcessingMode, which is a bit ugly, but it doesn't
5679+
* seem worth passing down an explicit flag saying we're doing
5680+
* read_nondefault_variables().
56725681
*/
5682+
#ifdef EXEC_BACKEND
5683+
if (IsUnderPostmaster && !IsInitProcessingMode())
5684+
return -1;
5685+
#else
56735686
if (IsUnderPostmaster)
56745687
return -1;
5688+
#endif
56755689
}
56765690
else if (context != PGC_POSTMASTER && context != PGC_BACKEND &&
56775691
source != PGC_S_CLIENT)
@@ -8310,6 +8324,12 @@ read_nondefault_variables(void)
83108324
GucSource varsource;
83118325
GucContext varscontext;
83128326

8327+
/*
8328+
* Assert that PGC_BACKEND case in set_config_option() will do the right
8329+
* thing.
8330+
*/
8331+
Assert(IsInitProcessingMode());
8332+
83138333
/*
83148334
* Open file
83158335
*/

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy