How to simulate KEY_BUSY hot key error code 14 in Aerospike

Viewed 86

How can I test/produce an Aerospike exception code 14?

I have a simple one node environment with Aerospike in it and a java application on K8s.

There are 3 pods of the application, all are consuming messages from Kafka topic with 3 partitions, all in the same consumer group.

With Kafka producer driver, we inject at once 200 messages, with no Kafka message key (so that kafka will round robin on the 3 topic partitions).

All messages relate to the same Aerospike key so the 3 application pods suppose to update the same record in parallel, resulting with Aerospike hotkey exception (KEY_BUSY, error code 14). But that's not happening and all 200 messages are processed successfully.

The configuration parameter "transaction-pending-limit" is set to 1 in aerospike.conf.

Many thanks.

1 Answers

Try adding one more node in the Aerospike cluster. With a one node Aerospike cluster, you are not replicating to another node. So the transaction is completing before you can encounter "key busy". Adding another node to the Aerospike cluster with replication factor 2 will cause the current transaction to wait in the queue for the replication ack and then, I believe, you will be able to simulate key busy error with transaciton-pending-limit set to 1. Let us know if that works for you.

Related