Commit 898a792e authored by Fujii Masao's avatar Fujii Masao

Fix connection leak in DROP SUBSCRIPTION command.

Previously the command forgot to close the connection to the publisher
when it failed to drop the replication slot.
parent 1d04a59b
...@@ -546,10 +546,14 @@ DropSubscription(DropSubscriptionStmt *stmt) ...@@ -546,10 +546,14 @@ DropSubscription(DropSubscriptionStmt *stmt)
errdetail("The error was: %s", err))); errdetail("The error was: %s", err)));
if (!walrcv_command(wrconn, cmd.data, &err)) if (!walrcv_command(wrconn, cmd.data, &err))
{
/* Close the connection in case of failure */
walrcv_disconnect(wrconn);
ereport(ERROR, ereport(ERROR,
(errmsg("could not drop the replication slot \"%s\" on publisher", (errmsg("could not drop the replication slot \"%s\" on publisher",
slotname), slotname),
errdetail("The error was: %s", err))); errdetail("The error was: %s", err)));
}
else else
ereport(NOTICE, ereport(NOTICE,
(errmsg("dropped replication slot \"%s\" on publisher", (errmsg("dropped replication slot \"%s\" on publisher",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment