Prevent cyclic in XDR

Dear all,

I would like to use 2 clusters including cluster 1 and cluster 2. Cluster 1 is a primary cluster and cluster 2 is a secondary cluster. Data is replicated from cluster 1 to cluster 2. When cluster 1 died, cluster 2 will become a primary. Moreover, when cluster 2 is restarted, it will become a secondary. Therefore, cluster 2 is a secondary cluster in the configuration of cluster 1 and cluster 1 is a secondary cluster in the configuration of cluster 2.

I know that I can config parameter “xdr-enable = false” in configuration of cluster 2 to disable the data replication to cluster 1.

What happens when I config “xdr-enable = true” in two cluster configurations? How to prevent cyclic in this case.

Many thanks,

Chuyen Luong

By default, when XDR in cluster-1 ships to cluster-2, cluster-2 realizes that XDR shipped to it and will not log them. So, enabling XDR in both cluster-1 and 2 will not cause a cyclic replication. Just make sure that ‘forward-xdr-writes’ config is not enabled. As the name suggests, it will enable/disable forwarding of XDR writes. So, in your case, you can keep xdr-enable = true in both clusters without fear of forming a cycle.

1 Like

Keep in mind though if a key is written for cluster1 and cluster2 close to each other, while both xdr shipping, a write collision will happen and one of the writes will be lost (unless both writes were identical!).

Thank you for the reminder.

In my case, I only use one cluster for handling the client’s request.

Could you explain the technique for realizing the shipped data to avoid cycling?

by default XDR writes will not be forwarded. How to Forward Writes Originating from XDR

Any write coming to a cluster is either from a client connected to the cluster or from a remote xdr client (and any failed shipments that are to be re-logged - but lets not bring that into the mix in this discussion). There is one identification bit in the write overhead with tells the cluster if the write is from an xdr client. If the write is identified as one from an xdr client, its not logged into the digestlog for shipping by this cluster’s xdr client. (Unless you set xdr forwarding to be true.) Thats how it works under the covers for you, automatically.

In other case, I have three clusters with three active-active couples (cluster 1 - cluster 2, cluster 2 - cluster 3, cluster 3 - cluster 1). If client writes a request to cluster 1, cluster 1 will replicate data to cluster 2 and cluster 3. In cluster 2, cluster 2 realizes that data is of cluster 1, then it will not ship back data to cluster 1. However, this data will continue to be replicated from cluster 2 to cluster 3. Therefore, the same data is replicated from cluster 2 to cluster 3 and from cluster 1 to cluster 3.

Please correct my understanding.

Many thanks.

The ring replication that you talk about will not happen. xdr forwarding, when enabled, is to all connected clusters. You have xdr forwarding disabled - so if 1 xdr’s to 2, that client 1’s writes go to 1 and xdr’d to 2. Likewise, 2 will send to 3 only writes coming from non-xdr clients connected to 2. 1’s xdr write to 2 will not be sent by 2’s xdr to 3. Does that clear it up?

1 Like

Thank you very much.

I understood this problem clearly.

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.