I am using aerospike server as a response cache system. The system is multienvironment. The system does the following:
- gets cached response for a user.
- deletes the cache.
- fills the cache with new response for the same user.
However, due to the multienvironment it can happen that after the cache is retrieved, the same user calls the system from another instance and the system fills the response again, but the response will be deleted if any slight lattency from the 1st query.
I implemented a UDF lua function, used in the apply() method - all works fine. My question is is this lua script transactional? Meaning that the mentioned above scenario won’t happen in case of multienv users. Here is the lua code: function get_and_delete(rec, bin) local response = rec[bin]
aerospike:remove(rec) return response
Thanks in advance!