From 3065966d139ffb07218367be1b51f3a124bc0e4a Mon Sep 17 00:00:00 2001 From: Onder Kalaci Date: Wed, 27 Jan 2021 10:17:56 +0100 Subject: [PATCH] When reaches to executor pool size, COPY sets the placement access It looks like we forgot to set the placement accesses, and this could lead to self-deadlocks on complex transaction blocks. (cherry picked from commit 36bdeef1bbb23e52178c0fa4739955200a6c06fc) --- src/backend/distributed/commands/multi_copy.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/backend/distributed/commands/multi_copy.c b/src/backend/distributed/commands/multi_copy.c index f681f7801..44442c0ab 100644 --- a/src/backend/distributed/commands/multi_copy.c +++ b/src/backend/distributed/commands/multi_copy.c @@ -3585,6 +3585,12 @@ CopyGetPlacementConnection(HTAB *connectionStateHash, ShardPlacement *placement, */ Assert(connection != NULL); + /* + * Make sure that the connection management remembers that Citus + * accesses this placement over the connection. + */ + AssignPlacementListToConnection(list_make1(placementAccess), connection); + return connection; }