mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
Add missing connection close
In a corner-case situation where a standby is unable to attach to the new primary due to a mismatch in the WAL stream, the connection used to verify the recovery status of the new primary was not being closed, leading to a risk of connection exhaustion on the new primary. Addresses GitHub #682.
This commit is contained in:
@@ -3921,6 +3921,7 @@ follow_new_primary(int new_primary_id)
|
||||
|
||||
termPQExpBuffer(&event_details);
|
||||
|
||||
close_connection(&upstream_conn);
|
||||
close_connection(&old_primary_conn);
|
||||
|
||||
return FAILOVER_STATE_PRIMARY_REAPPEARED;
|
||||
@@ -3931,6 +3932,8 @@ follow_new_primary(int new_primary_id)
|
||||
close_connection(&old_primary_conn);
|
||||
}
|
||||
|
||||
close_connection(&upstream_conn);
|
||||
|
||||
return FAILOVER_STATE_FOLLOW_FAIL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user