project-pegaprox icon indicating copy to clipboard operation
project-pegaprox copied to clipboard

[Bug] Emergency Failover can result in source and target VM running simultaneously after source cluster recovery

Open Br00dkast opened this issue 2 months ago • 1 comments

Hey there! 👋 Thanks for taking the time to report this bug — we appreciate it!

Please keep in mind: PegaProx is developed and maintained entirely by volunteers in our free time. We do our best, but we can't work magic 🪄 — please be patient, we'll get to your issue as soon as we can.

Want to help keep PegaProx alive?

  • ⭐ [Star the project](https://github.com/PegaProx/project-pegaprox) — it's free and helps a lot!
  • 💖 [Become a Sponsor](https://pegaprox.com/#sponsor) — helps us dedicate more time to development
  • 🤝 Contributing code or docs is always welcome too!

Describe the bug

Emergency Failover can result in both the source VM and replicated target VM running at the same time when the source cluster comes back online.

I tested Emergency Failover by making the source cluster unavailable and triggering the failover manually.

The replicated VM started correctly on the target cluster.

However, when the source cluster came back online, the original VM started there again as well. This resulted in two copies of the same VM running simultaneously on separate clusters, creating a split-brain situation.

I understand that the source cluster cannot necessarily be fenced while it is unreachable. However, after Emergency Failover has been performed, I would expect PegaProx to retain some form of recovery/failover state so that the original VM cannot automatically return to service without an explicit recovery or failback action.

At the moment, a successful Emergency Failover appears to protect the target-side startup, but not the source-side recovery.

Steps to Reproduce

  1. Configure a VM with cross-cluster replication.
  2. Allow replication to complete so a standby copy exists on the target cluster.
  3. Make the source cluster unavailable.
  4. Trigger Emergency Failover.
  5. Verify that the replicated VM starts successfully on the target cluster.
  6. Bring the source cluster back online.
  7. Observe that the original VM can start again on the source cluster.
  8. Both the source and target copies of the same VM are now running simultaneously.

Expected behavior

After Emergency Failover is triggered, PegaProx should maintain a failover/recovery state that prevents the original VM from automatically returning to service when the source cluster becomes reachable again.

For example, the workflow could require one or more of the following before the source VM is allowed to run again:

  • Explicit failback or recovery confirmation.
  • Source VM being marked as failed over / blocked from automatic startup.
  • Verification that only one copy of the VM is active.
  • A recovery workflow that reconciles which cluster is authoritative.
  • Fencing or equivalent protection where technically possible.

The important requirement is that Emergency Failover should not result in both copies becoming active without an explicit operator action.

Environment

  • PegaProx Version: 1.1.1
  • Installation Method: Docker
  • OS: Debian 13
  • Browser: Chrome
  • Behind Reverse Proxy?
  • UI?

Logs

Screenshots

Checklist

  • [ ] I have searched existing issues to make sure this is not a duplicate
  • [ ] I am using the latest version of PegaProx

Br00dkast avatar Sep 10 '26 13:09 Br00dkast

You're right, and it's not a small one. There's no failed-over state on our side at all — emergency failover starts the target and that's where it ends. Nothing marks the source as no longer authoritative, so when that cluster comes back its guests boot exactly as they did before. Checked it this morning to be sure I wasn't remembering wrong.

So this isn't a missing guard we can bolt on; it's deciding what "authoritative side" means for us and what failback then does with it. Assigning to Nico, that's a design call rather than something I should patch my way into.

Good catch, and thanks for splitting it out of the other thread.

Marcus

(we run on donations, if you're so inclined: https://opencollective.com/pegaprox)

mkellermann97 avatar Sep 11 '26 07:09 mkellermann97