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.
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.
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!).
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.
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?