Skip to content

Commit a47606d

Browse files
dutowjeltz
authored andcommitted
Register built-in dynamic managers in EXEC_BACKEND child
Under EXEC_BACKEND the exec'd child starts with an empty (palloc'd) smgr table; register_builtin_dynamic_managers() is only called from the postmaster (inherited via fork) and InitStandaloneProcess. Re-run it in SubPostmasterMain, before process_shared_preload_libraries(), mirroring the postmaster so extensions can still register their own smgrs.
1 parent d52ff64 commit a47606d

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/backend/postmaster/launch_backend.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,15 @@ SubPostmasterMain(int argc, char *argv[])
669669

670670
RegisterBuiltinShmemCallbacks();
671671

672+
/*
673+
* Re-register built-in dynamic managers (e.g. md smgr). On fork-based
674+
* platforms the child inherits the postmaster's already-populated smgr
675+
* table; under EXEC_BACKEND the child starts with an empty table, so we
676+
* must re-run registration. Must happen before shared_preload_libraries
677+
* so extensions can still register their own smgrs from _PG_init().
678+
*/
679+
register_builtin_dynamic_managers();
680+
672681
/*
673682
* Reload any libraries that were preloaded by the postmaster. Since we
674683
* exec'd this process, those libraries didn't come along with us; but we

0 commit comments

Comments
 (0)