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

Commit f13c5a7

Browse files
committed
[refer #PGPRO-3213] Fix bug with inheritance of postmaster sockets during online upgrade
1 parent 1f29b15 commit f13c5a7

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/backend/postmaster/postmaster.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,12 +1376,14 @@ PostmasterMain(int argc, char *argv[])
13761376
* First, mark them all closed, and set up an on_proc_exit function that's
13771377
* charged with closing the sockets again at postmaster shutdown.
13781378
*/
1379-
for (i = 0; i < MAXLISTEN; i++)
1380-
ListenSocket[i] = PGINVALID_SOCKET;
1381-
1379+
if (!IsOnlineUpgrade)
1380+
{
1381+
for (i = 0; i < MAXLISTEN; i++)
1382+
ListenSocket[i] = PGINVALID_SOCKET;
1383+
}
13821384
on_proc_exit(CloseServerPorts, 0);
13831385

1384-
if (ListenAddresses)
1386+
if (ListenAddresses && !IsOnlineUpgrade)
13851387
{
13861388
char *rawstring;
13871389
List *elemlist;

0 commit comments

Comments
 (0)