Avoid deadlocks on split failure by closing connections

pull/6137/head
Marco Slot 2022-08-05 18:48:03 +02:00 committed by Marco Slot
parent 044dd26e40
commit ead9d28835
1 changed files with 6 additions and 0 deletions

View File

@ -575,6 +575,9 @@ BlockingShardSplit(SplitOperation splitOperation,
} }
PG_CATCH(); PG_CATCH();
{ {
/* end ongoing transactions to enable us to clean up */
ShutdownAllConnections();
/* Do a best effort cleanup of shards created on workers in the above block */ /* Do a best effort cleanup of shards created on workers in the above block */
TryDropSplitShardsOnFailure(mapOfShardToPlacementCreatedByWorkflow); TryDropSplitShardsOnFailure(mapOfShardToPlacementCreatedByWorkflow);
@ -1447,6 +1450,9 @@ NonBlockingShardSplit(SplitOperation splitOperation,
} }
PG_CATCH(); PG_CATCH();
{ {
/* end ongoing transactions to enable us to clean up */
ShutdownAllConnections();
/* Do a best effort cleanup of shards created on workers in the above block */ /* Do a best effort cleanup of shards created on workers in the above block */
TryDropSplitShardsOnFailure(mapOfShardToPlacementCreatedByWorkflow); TryDropSplitShardsOnFailure(mapOfShardToPlacementCreatedByWorkflow);