Fix running Postgres in "vanilla mode", without neon storage

Some tests do that
This commit is contained in:
Heikki Linnakangas
2025-07-03 00:32:40 +03:00
parent d8296e60e6
commit d8556616c9
2 changed files with 13 additions and 1 deletions

View File

@@ -126,6 +126,12 @@ pg_init_communicator_new(void)
{
BackgroundWorker bgw;
if (pageserver_connstring[0] == '\0' && pageserver_grpc_urls[0] == '\0')
{
/* running with local storage */
return;
}
/* Initialize the background worker process */
memset(&bgw, 0, sizeof(bgw));
bgw.bgw_flags = BGWORKER_SHMEM_ACCESS;
@@ -382,6 +388,12 @@ communicator_new_init(void)
Assert(cis != NULL);
Assert(my_bs == NULL);
if (pageserver_connstring[0] == '\0' && pageserver_grpc_urls[0] == '\0')
{
/* running with local storage */
return;
}
if (MyBgworkerEntry && strcmp(MyBgworkerEntry->bgw_function_name, "communicator_new_bgworker_main") == 0)
return;

View File

@@ -1621,7 +1621,7 @@ pg_init_libpagestore(void)
if (neon_auth_token)
neon_log(LOG, "using storage auth token from NEON_AUTH_TOKEN environment variable");
if (pageserver_connstring[0] || pageserver_connstring[0])
if (pageserver_connstring[0] || pageserver_grpc_urls[0])
{
neon_log(PageStoreTrace, "set neon_smgr hook");
smgr_hook = smgr_neon;