[backport] prevent data loss while promoting from second replica to owner.

Fixes #2785