hapostgres / pg_auto_failover

Postgres extension and service for automated failover and high-availability
Other
1.07k stars 112 forks source link

Make checkPgAutoFailoverVersion void #949

Closed danielgustafsson closed 1 year ago

danielgustafsson commented 1 year ago

The checkPgAutoFailoverVersion() function was defined having a bool return type, but in practice it could only return true as the error paths were using ereport() which doesn't return. No callers of the function inspected the return value for good reason. Refactor to a void function which better match reality.

While there, also make sure that that fast-exit path is taken before any memory is allocated.