# Zero data loss auto failover and sync old primary as replica without need of rebuild

**URL:** <https://forums.percona.com/t/zero-data-loss-auto-failover-and-sync-old-primary-as-replica-without-need-of-rebuild/28544>\
**Category:** Uncategorized\
**Created:** [February 18, 2024, 7:11pm UTC](https://forums.percona.com/t/zero-data-loss-auto-failover-and-sync-old-primary-as-replica-without-need-of-rebuild/28544 "2024-02-18T19:11:08Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sanjay\_Sheoran](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/sanjay_sheoran/32/5351_2.png) [@Sanjay\_Sheoran](https://forums.percona.com/u/Sanjay_Sheoran)\
**Post date:** [February 18, 2024, 7:11pm UTC](https://forums.percona.com/t/zero-data-loss-auto-failover-and-sync-old-primary-as-replica-without-need-of-rebuild/28544/1 "2024-02-18T19:11:08Z")

</div>

Hi,

We want to enable auto failover with zero data loss and we want to avoid replica rebuild to resync the old primary without compromising with data consistently

Whats best solution with percona mysql server

---

<div class="post-metadata">

**Author:** ![Sanjay\_Sheoran](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/sanjay_sheoran/32/5351_2.png) [@Sanjay\_Sheoran](https://forums.percona.com/u/Sanjay_Sheoran)\
**Post date:** [February 18, 2024, 7:28pm UTC](https://forums.percona.com/t/zero-data-loss-auto-failover-and-sync-old-primary-as-replica-without-need-of-rebuild/28544/2 "2024-02-18T19:28:35Z")

</div>

I read this document but it does not talk about syncing our primary back as primary without rebuild

> **[Face to Face with Semi-Synchronous Replication](https://www.percona.com/blog/face-to-face-with-semi-synchronous-replication/)**
>
> Taking a look at the needs and expectations of the semi-synchronous (semi-sync) solution for MySQL.

---

<div class="post-metadata">

**Author:** ![Sergey\_Pronin](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/sergey_pronin/32/14887_2.png) [@Sergey\_Pronin](https://forums.percona.com/u/Sergey_Pronin)\
**Post date:** [February 18, 2024, 9:05pm UTC](https://forums.percona.com/t/zero-data-loss-auto-failover-and-sync-old-primary-as-replica-without-need-of-rebuild/28544/3 "2024-02-18T21:05:36Z")

</div>

Hey @Sanjay_Sheoran ,

could you please share more here? Would be great to see some graphical vizualization of what are you trying to do.

If I understand it correctly, you want to fail back, after the failover to your other site happened. It might require some additional steps as reconfiguring your _old_ primary as secondary to your active cluster.

---

<div class="post-metadata">

**Author:** ![Sanjay\_Sheoran](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/sanjay_sheoran/32/5351_2.png) [@Sanjay\_Sheoran](https://forums.percona.com/u/Sanjay_Sheoran)\
**Post date:** [February 18, 2024, 10:33pm UTC](https://forums.percona.com/t/zero-data-loss-auto-failover-and-sync-old-primary-as-replica-without-need-of-rebuild/28544/4 "2024-02-18T22:33:52Z")

</div>

I want to reconfigure old primary as replica without any data loss/inconsistency after auto failover

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [February 20, 2024, 4:58pm UTC](https://forums.percona.com/t/zero-data-loss-auto-failover-and-sync-old-primary-as-replica-without-need-of-rebuild/28544/5 "2024-02-20T16:58:50Z")

</div>

Hello @Sanjay_Sheoran,  
You have not specified if this is async replication, or Percona XtraDB Cluster, or Group Replication?

---

<div class="post-metadata">

**Author:** ![Sanjay\_Sheoran](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/sanjay_sheoran/32/5351_2.png) [@Sanjay\_Sheoran](https://forums.percona.com/u/Sanjay_Sheoran)\
**Post date:** [February 21, 2024, 3:11am UTC](https://forums.percona.com/t/zero-data-loss-auto-failover-and-sync-old-primary-as-replica-without-need-of-rebuild/28544/6 "2024-02-21T03:11:31Z")

</div>

We have percona SQL Server with semi sync replication and setup will be one primary and semi sync replication in same region

Now we want to make sure we can achieve zero data loss plus sync the replication back with out need of rebuild and make sure data is also consistent

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [February 21, 2024, 4:11pm UTC](https://forums.percona.com/t/zero-data-loss-auto-failover-and-sync-old-primary-as-replica-without-need-of-rebuild/28544/7 "2024-02-21T16:11:21Z")

</div>

> [@Sanjay\_Sheoran](#):
>
> semi sync replication

Please note that semi-sync replication is deprecated in 8.0 and may be removed in future releases.

You will need to configure source/source replication. This is where node1 is source and node2 is replica, but also node2 is source and node1 is replica.

For the “auto failover” part, you will need to implement a failover tool like HAProxy or ProxySQL to redirect traffic to node2 if node1 goes offline.

---

<div class="post-metadata">

**Author:** ![Sanjay\_Sheoran](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/sanjay_sheoran/32/5351_2.png) [@Sanjay\_Sheoran](https://forums.percona.com/u/Sanjay_Sheoran)\
**Post date:** [February 22, 2024, 7:57am UTC](https://forums.percona.com/t/zero-data-loss-auto-failover-and-sync-old-primary-as-replica-without-need-of-rebuild/28544/8 "2024-02-22T07:57:06Z")

</div>

Thank You, do you have any documentation for semi sync deprecation

“Please note that semi-sync replication is deprecated in 8.0 and may be removed in future releases.”

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [February 22, 2024, 3:56pm UTC](https://forums.percona.com/t/zero-data-loss-auto-failover-and-sync-old-primary-as-replica-without-need-of-rebuild/28544/9 "2024-02-22T15:56:15Z")

</div>

Percona XtraDB Cluster, or MySQL/Percona Group Replication

---

<div class="post-metadata">

**Author:** ![Chanakya](https://avatars.discourse-cdn.com/v4/letter/c/cab0a1/32.png) [@Chanakya](https://forums.percona.com/u/Chanakya)\
**Post date:** [February 22, 2024, 5:05pm UTC](https://forums.percona.com/t/zero-data-loss-auto-failover-and-sync-old-primary-as-replica-without-need-of-rebuild/28544/10 "2024-02-22T17:05:03Z")

</div>

Hi @matthewb

Can you please share a reference to doc for “semi sync replication deprecation” ?  
This is crucial for us in deciding on next steps.

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [February 22, 2024, 6:53pm UTC](https://forums.percona.com/t/zero-data-loss-auto-failover-and-sync-old-primary-as-replica-without-need-of-rebuild/28544/11 "2024-02-22T18:53:40Z")

</div>

Hi @Chanakya,  
I could not find any documentation on the deprecation. I asked those that shared the info with me and it came from a private conversation at Percona Live last year with some MySQL engineers. As such, I’m no longer mentioning this and you should continue until such a time it is noted in the release notes.

---

<div class="post-metadata">

**Author:** ![Chanakya](https://avatars.discourse-cdn.com/v4/letter/c/cab0a1/32.png) [@Chanakya](https://forums.percona.com/u/Chanakya)\
**Post date:** [February 29, 2024, 11:59pm UTC](https://forums.percona.com/t/zero-data-loss-auto-failover-and-sync-old-primary-as-replica-without-need-of-rebuild/28544/12 "2024-02-29T23:59:37Z")

</div>

Thank you @matthewb We will proceed with experimenting it.
