How do I enable bin convergence as I plan an upgrade to server version 5.4+?

How do I enable bin convergence as I plan an upgrade to server version 5.4+?

Context

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.

Method

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.

  1. Upgrade all nodes in all XDR datacenters to 5.4+. Refer to the Upgrade Aerospike documentation for details.

  2. Apply the relevant configuration dynamically. You must complete each step on all nodes in all DCs before proceeding to the next step:

  • Set conflict-resolve-writes to true in 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'"
  • Set src-id in 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>'"
  • Set bin-policy in 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'"
  • Set ship-bin-luts to true in 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.

Notes

Keywords

BIN CONVERGENCE BIN-POLICY

Timestamp

March 2021

© 2021 Copyright Aerospike, Inc. | All rights reserved. Creators of the Aerospike Database.