Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 6c31ac0

Browse files
committed
Process shared_preload_libraries in single-user mode.
Without processing shared_preload_libraries, it's impossible to recover if custom WAL resource managers are needed. It may also pose a problem running VACUUM on a table with a custom AM, if the module implementing the AM is expecting to be loaded by shared_preload_libraries. The reason this wasn't done before was just the general principle to do fewer things in single-user mode. But it's easy enough to just set shared_preload_libraries to empty, for the same effect. Discussion: https://postgr.es/m/9decc18a42634f8a2f15c97a385a0f51a752f396.camel%40j-davis.com Reviewed-by: Tom Lane, Andres Freund Backpatch-through: 15
1 parent 2d04277 commit 6c31ac0

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/backend/tcop/postgres.c

+23
Original file line numberDiff line numberDiff line change
@@ -3933,9 +3933,32 @@ PostgresSingleUserMain(int argc, char *argv[],
39333933
/* read control file (error checking and contains config ) */
39343934
LocalProcessControlFile(false);
39353935

3936+
/*
3937+
* process any libraries that should be preloaded at postmaster start
3938+
*/
3939+
process_shared_preload_libraries();
3940+
39363941
/* Initialize MaxBackends */
39373942
InitializeMaxBackends();
39383943

3944+
/*
3945+
* Give preloaded libraries a chance to request additional shared memory.
3946+
*/
3947+
process_shmem_requests();
3948+
3949+
/*
3950+
* Now that loadable modules have had their chance to request additional
3951+
* shared memory, determine the value of any runtime-computed GUCs that
3952+
* depend on the amount of shared memory required.
3953+
*/
3954+
InitializeShmemGUCs();
3955+
3956+
/*
3957+
* Now that modules have been loaded, we can process any custom resource
3958+
* managers specified in the wal_consistency_checking GUC.
3959+
*/
3960+
InitializeWalConsistencyChecking();
3961+
39393962
CreateSharedMemoryAndSemaphores();
39403963

39413964
/*

0 commit comments

Comments
 (0)