prevent data loss while promoting from second replica to owner.

Fixes #2785
test seems to me very long. if it is possible, dividing it small meaningful parts may be very helpful for the future viewer.