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:");