Search code examples
javaaerospike

Rare case seen when Aerospike give older value but not updated value


In distributed environment daily 2 million request comes then first we try to read the data and then update the data in aerospike on the basis of key. But in rare case some time when we are reading the data then it read the older value.

The average time between the updating the value and reading that value is 10sec in which these issue come. So can someone please help me to figure out where is the problem either it is in setup or in code.


Solution

  • CAP theorem matters if there are node failures or nodes going in and out of the cluster. Reading stale reads, even in AP mode, in a stable cluster, does not add up. Secondly, Aerospike is not an eventually consistent design - it is immediately consistent in a stable cluster because it is not a consensus based design. So either the cluster is unstable due to network issues and nodes are going in and out or some combination of network events is causing this or there is some issue with the code. Hard to diagnose just by a statement of end observation. So 1) Is the cluster stable thru these events? 2) What is the Aerospike version? Edition - Community or Enterprise? 3) Cluster size? 4) Namespace configuration? 5) Replication factor? 6) Code snippet / data model / what exactly are you doing in code? If the write update fails, how are you handling it in code?