How do I enable bin convergence as I plan an upgrade to server version 5.4+?
Aerospike version 5.4 introduced the bin convergence feature which ensures the values of a given record to always match in mesh/active-active topologies (the data is eventually the same in all the DCs at the end of replication even if there are simultaneous updates to the same record in multiple DCs). To achieve this, the last-update-time or LUT of each bin is stored and shipped to the destination clusters. A bin with a higher timestamp (LUT) is allowed to overwrite a bin with a lower timestamp (LUT).
Refer to the Bin Convergence documentation for further details.
When upgrading to 5.4+ while enabling bin convergence we would need to follow the steps below in order to ensure that the configuration is setup correctly and works as expected.
Upgrade all nodes in all XDR datacenters to 5.4+. Refer to the Upgrade Aerospike documentation for details.
Apply the relevant configuration dynamically. You must complete each step on all nodes in all DCs before proceeding to the next step:
truein the namespace section for all the namespaces participating in XDR where the bin convergence feature should be enabled:
asadm -e "asinfo -v 'set-config:context=namespace;id=namespaceName;conflict-resolve-writes=true'"
src-idin the XDR section. A non-zero unique value should be selected for each DC (this is necessary for breaking ties when the values for a bin have to be compared when the LUT matches – the precision is 1 millisecond).
asadm -e "asinfo -v 'set-config:context=xdr;src-id=<uniqueid>'"
bin-policyin the namespace section with the DC stanza in the XDR to something other than ‘all’. This should be done for all namespaces in all DCs.
asadm -e "asinfo -v 'set-config:context=xdr;dc=DC1;namespace=nameSpaceName;bin-policy=only-changed'"
truein the per-namespace per-DC section in XDR. This should be done for all namespaces in all DCs.
asadm -e "asinfo -v 'set-config:context=xdr;dc=DC1;namespace=namespaceName;ship-bin-luts=true'"
Note: It is recommended to change all the configuration in aerospike.conf in order to reflect the dynamic configurations in case of an Aerospike restart.
BIN CONVERGENCE BIN-POLICY