aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2024-03-04 12:56:02 +0200
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2024-03-04 12:56:02 +0200
commit0dd094c4a0a4766cfb3c4932fa32af906229e3e3 (patch)
tree67df1d62eceb9d3c67a3652ef0977b9b67dc76c1
parent8545b28679a2ec2aa66ad2ec81f17019dab5d780 (diff)
downloadpostgresql-0dd094c4a0a4766cfb3c4932fa32af906229e3e3.tar.gz
postgresql-0dd094c4a0a4766cfb3c4932fa32af906229e3e3.zip
Remove unused ParallelWorkerInfo.pid field
The pid was originally used in error context of messages propagated from parallel workers, but commit 292794f82b 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".
-rw-r--r--src/backend/access/transam/parallel.c23
-rw-r--r--src/include/access/parallel.h1
2 files changed, 0 insertions, 24 deletions
diff --git a/src/backend/access/transam/parallel.c b/src/backend/access/transam/parallel.c
index cbfe6087da4..798cd86c881 100644
--- a/src/backend/access/transam/parallel.c
+++ b/src/backend/access/transam/parallel.c
@@ -1131,16 +1131,6 @@ HandleParallelMessage(ParallelContext *pcxt, int i, StringInfo msg)
switch (msgtype)
{
- case PqMsg_BackendKeyData:
- {
- int32 pid = pq_getmsgint(msg, 4);
-
- (void) pq_getmsgint(msg, 4); /* discard cancel key */
- (void) pq_getmsgend(msg);
- pcxt->worker[i].pid = pid;
- break;
- }
-
case PqMsg_ErrorResponse:
case PqMsg_NoticeResponse:
{
@@ -1304,7 +1294,6 @@ ParallelWorkerMain(Datum main_arg)
char *relmapperspace;
char *uncommittedenumsspace;
char *clientconninfospace;
- StringInfoData msgbuf;
char *session_dsm_handle_space;
Snapshot tsnapshot;
Snapshot asnapshot;
@@ -1370,18 +1359,6 @@ ParallelWorkerMain(Datum main_arg)
fps->parallel_leader_proc_number);
/*
- * Send a BackendKeyData message to the process that initiated parallelism
- * so that it has access to our PID before it receives any other messages
- * from us. Our cancel key is sent, too, since that's the way the
- * protocol message is defined, but it won't actually be used for anything
- * in this case.
- */
- pq_beginmessage(&msgbuf, PqMsg_BackendKeyData);
- pq_sendint32(&msgbuf, (int32) MyProcPid);
- pq_sendint32(&msgbuf, (int32) MyCancelKey);
- pq_endmessage(&msgbuf);
-
- /*
* Hooray! Primary initialization is complete. Now, we need to set up our
* backend-local state to match the original backend.
*/
diff --git a/src/include/access/parallel.h b/src/include/access/parallel.h
index 64c6fb939ea..69ffe5498f9 100644
--- a/src/include/access/parallel.h
+++ b/src/include/access/parallel.h
@@ -26,7 +26,6 @@ typedef struct ParallelWorkerInfo
{
BackgroundWorkerHandle *bgwhandle;
shm_mq_handle *error_mqh;
- int32 pid;
} ParallelWorkerInfo;
typedef struct ParallelContext