How do we know if record has been locked in Aerospike?


#1

How to detect if record has been locked in Aerospike?? MySQL/Oracle provide command for checking list of locks on particular table, list of transactions waiting for locks ect. Are these facilities available in Aerospike??


Is Record UDF calling thread safe?
#2

Hi Mangesh,

A record is only locked only for the duration of a read or a write. Locks cannot be held for a longer period.

If many request for a record arrive concurrently, they are placed in a queue and serviced first-in first-out. The default queue size is 20, this can be adjusted in the server configuration file aerospike.conf by changing the value transaction-pending-limit.

If more requests arrive than the size of the queue, the client will receive the result code of 14 - KEY BUSY.

I hope this helps

Regards

Peter


#3

Mangesh,

In addition to what helipilot already mentioned, Aerospike doesn’t support multi-record transactions, hence doesn’t have begin_transaction, end_transaction semantics similar to what you would find in Oracle, MySQL. This means that the client application cannot explicitly lock a record, but locking/unlocking of a record is handled by the server for very brief period of time, with no control of such locking provided to the client application.

This scheme doesn’t require the client application to know if and when a record is locked.

-samir