The cluster of 3+ servers must remain consistent, available, and not lose committed transactions when a minority of servers (including the former master) fails.
I’ve had good experiences with logical replication and pg_auto_failover. The cool thing is that the libpq-based clients do some of the work during failovers. You’ll need three nodes though.