How generation field gets updated when XDR is replicating the record

Aerospike uses generation number indicating the number of times the same record is updated in a region. If we configure XDR and if we update the same record at both the places then how does the generation number gets incremented, when the SET record operation is exercised in each region ? and when the XDR replicates the record?

Thanks Venkata

The generation in each region would be independent… Think about XDR as any other client updating the record at the destination cluster… so, if you have XDR writing into a cluster and another client writing into the same cluster updating the same record, the generation would increase by 2, one for each.

You are saying generation number is independent in each region. If X is the interval after which XDR replicates the data, then in X interval, if a record in one colo is updated let us say k times, then it’s generation number gets incremented by k times, where as it’s peer gets incremented only once when XDR is replicating the same record. Is my understanding correct?

Yes that is absolutely correct…

Thank you so much Meher. I have one more doubt. I want to understand more about how XDR handles conflict resolutions.

for example,

if in one region, record r1 is written to bins b1, b2. b1 has CDT data of type Map { “F1” : “V1”, “F2:V2”} and b2 has CDT data of type Map {“F3” : “V3” }

In second region, record r1 data is written to bins b1, b3. b1 has CDT data of type Map {“F1”:“V3”, “F4”:“V5”} and b3 has CDT data of type Map { “F5” :“V5”}

If above writes happen simultaneously in both the regions, then what is the result after XDR replicates the data in both directions (from region 1 to region 2 and from region 2 to region 1)

The current version of XDR doesn’t do any conflict resolution. The latest record applied will ‘win’. Having said that we have some interesting features in development that will allow to update individual bins based on their updated time. I would encourage you to reach out to Aerospike Support to be put in contact with Solutions Architects to review your use case in more details and go over the XDR roadmap that would provide features to allow active / active situations as you describe.