From 20679c9e8b76e17ae282af5415dc011c9424c50c Mon Sep 17 00:00:00 2001 From: Onder Kalaci Date: Thu, 17 Aug 2017 19:37:40 +0300 Subject: [PATCH] Relax assertion on deadlock detection considering self deadlocks. --- .../transaction/distributed_deadlock_detection.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/backend/distributed/transaction/distributed_deadlock_detection.c b/src/backend/distributed/transaction/distributed_deadlock_detection.c index 6d8b108ed..73bb3896c 100644 --- a/src/backend/distributed/transaction/distributed_deadlock_detection.c +++ b/src/backend/distributed/transaction/distributed_deadlock_detection.c @@ -152,8 +152,12 @@ CheckForDistributedDeadlocks(void) TransactionNode *youngestTransaction = transactionNode; ListCell *participantTransactionCell = NULL; - /* there should be at least two transactions to get into a deadlock */ - Assert(list_length(deadlockPath) > 1); + /* + * There should generally be at least two transactions to get into a + * deadlock. However, in case Citus gets into a self-deadlock, we may + * find a deadlock with a single transaction. + */ + Assert(list_length(deadlockPath) >= 1); LogDistributedDeadlockDebugMessage("Distributed deadlock found among the " "following distributed transactions:");