I am trying to do atomic operations on a single bin set. However I am noticing a strange behaviour where randomly record is not getting incremented/decremented. Operate command is returning null in response. Not getting any exception as well. Sometimes it works and sometimes doesn’t.
Attempted to check using both persistent and inmemory storage. It’s a clustered environment of 3 nodes.
For some cases it gave Hot key error which i able to resolve by setting the property transaction-pending-limit = 0.
Aerospike client :
<dependency>
<groupId>com.aerospike</groupId>
<artifactId>aerospike-client</artifactId>
<version>5.1.5.1</version>
</dependency>
Operate command :
Record record = aerospikeClient.operate(aerospikeClient.writePolicyDefault, asKey, Operation.add(bin), Operation.get(bin.name));
Write policy :
WritePolicy writePolicy = new WritePolicy();
writePolicy.socketTimeout = 60000;
writePolicy.maxRetries = 2;
writePolicy.sendKey = true;
writePolicy.expiration = -1; // never expire record
writePolicy.respondAllOps=true;
writePolicy.durableDelete=true;