And after thinking about these changes, I realized that both of our
patches broke standby promotion: both resulted in cases where we
promoted the standby when we shouldn't have.
The attached v3 now doesn't modify the logic when we have a primary
connection set, and contains both patches in one file instead.