From 9f27e398a9c51b1d1cc9e7ea0fbd49537553ac7e 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 eb47a7ae2..2c5f55152 100644 --- a/src/backend/distributed/commands/multi_copy.c +++ b/src/backend/distributed/commands/multi_copy.c @@ -3583,6 +3583,12 @@ CopyGetPlacementConnection(HTAB *connectionStateHash, ShardPlacement *placement, nodeName, nodePort); + /* + * Make sure that the connection management remembers that Citus + * accesses this placement over the connection. + */ + AssignPlacementListToConnection(list_make1(placementAccess), connection); + return connection; }