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

Commit 0dd094c

Browse files
committed
Remove unused ParallelWorkerInfo.pid field
The pid was originally used in error context of messages propagated from parallel workers, but commit 292794f removed that. If the need arises in the future, you can also get the pid with "shm_mq_get_sender(pcxt->worker[i].error_mqh)->pid".
1 parent 8545b28 commit 0dd094c

File tree

2 files changed

+0
-24
lines changed

2 files changed

+0
-24
lines changed

src/backend/access/transam/parallel.c

-23
Original file line numberDiff line numberDiff line change
@@ -1131,16 +1131,6 @@ HandleParallelMessage(ParallelContext *pcxt, int i, StringInfo msg)
11311131

11321132
switch (msgtype)
11331133
{
1134-
case PqMsg_BackendKeyData:
1135-
{
1136-
int32 pid = pq_getmsgint(msg, 4);
1137-
1138-
(void) pq_getmsgint(msg, 4); /* discard cancel key */
1139-
(void) pq_getmsgend(msg);
1140-
pcxt->worker[i].pid = pid;
1141-
break;
1142-
}
1143-
11441134
case PqMsg_ErrorResponse:
11451135
case PqMsg_NoticeResponse:
11461136
{
@@ -1304,7 +1294,6 @@ ParallelWorkerMain(Datum main_arg)
13041294
char *relmapperspace;
13051295
char *uncommittedenumsspace;
13061296
char *clientconninfospace;
1307-
StringInfoData msgbuf;
13081297
char *session_dsm_handle_space;
13091298
Snapshot tsnapshot;
13101299
Snapshot asnapshot;
@@ -1369,18 +1358,6 @@ ParallelWorkerMain(Datum main_arg)
13691358
pq_set_parallel_leader(fps->parallel_leader_pid,
13701359
fps->parallel_leader_proc_number);
13711360

1372-
/*
1373-
* Send a BackendKeyData message to the process that initiated parallelism
1374-
* so that it has access to our PID before it receives any other messages
1375-
* from us. Our cancel key is sent, too, since that's the way the
1376-
* protocol message is defined, but it won't actually be used for anything
1377-
* in this case.
1378-
*/
1379-
pq_beginmessage(&msgbuf, PqMsg_BackendKeyData);
1380-
pq_sendint32(&msgbuf, (int32) MyProcPid);
1381-
pq_sendint32(&msgbuf, (int32) MyCancelKey);
1382-
pq_endmessage(&msgbuf);
1383-
13841361
/*
13851362
* Hooray! Primary initialization is complete. Now, we need to set up our
13861363
* backend-local state to match the original backend.

src/include/access/parallel.h

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ typedef struct ParallelWorkerInfo
2626
{
2727
BackgroundWorkerHandle *bgwhandle;
2828
shm_mq_handle *error_mqh;
29-
int32 pid;
3029
} ParallelWorkerInfo;
3130

3231
typedef struct ParallelContext

0 commit comments

Comments
 (0)