Commit bde39eed authored by Robert Haas's avatar Robert Haas

Fix a couple of bugs in recent parallelism-related commits.

Commit 816e336f added the wrong error
check to async.c; sending restrictions is restricted to the leader,
not altogether unsafe.

Commit 3bd909b2 added ExecShutdownNode
to traverse the planstate tree and call shutdown functions, but made
a Gather node, the only node that actually has such a function, abort
the tree traversal, which is wrong.
parent 1a219fa1
...@@ -117,6 +117,7 @@ ...@@ -117,6 +117,7 @@
#include <unistd.h> #include <unistd.h>
#include <signal.h> #include <signal.h>
#include "access/parallel.h"
#include "access/slru.h" #include "access/slru.h"
#include "access/transam.h" #include "access/transam.h"
#include "access/xact.h" #include "access/xact.h"
...@@ -544,8 +545,8 @@ Async_Notify(const char *channel, const char *payload) ...@@ -544,8 +545,8 @@ Async_Notify(const char *channel, const char *payload)
Notification *n; Notification *n;
MemoryContext oldcontext; MemoryContext oldcontext;
if (IsInParallelMode()) if (IsParallelWorker())
elog(ERROR, "cannot send notifications during a parallel operation"); elog(ERROR, "cannot send notifications from a parallel worker");
if (Trace_notify) if (Trace_notify)
elog(DEBUG1, "Async_Notify(%s)", channel); elog(DEBUG1, "Async_Notify(%s)", channel);
......
...@@ -804,10 +804,7 @@ ExecShutdownNode(PlanState *node) ...@@ -804,10 +804,7 @@ ExecShutdownNode(PlanState *node)
switch (nodeTag(node)) switch (nodeTag(node))
{ {
case T_GatherState: case T_GatherState:
{ ExecShutdownGather((GatherState *) node);
ExecShutdownGather((GatherState *) node);
return true;
}
break; break;
default: default:
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment