Context
In the aerospike logs, specific warnings do print the digest of the affected record. To address the issue, it may me necessary to determine the set name containing the data for the digest. The following UDF/LUA code provides a method to return the set name using the digest.Method
In the aerospike logs the following output may be observed:May 07 2018 07:07:07 GMT: WARNING (rw): (write.c:1508) {namespace} write_master: failed as_storage_record_write() <Digest>:0x2263c4bbe8f3ecfdfe1f67391f3627c8a3b7eada
Here is a solution using UDF’s to return the set name.
Step 1:
Create the lua file (e.g. setname.lua).
function get(rec) return record.setname(rec) end
Step 2:
Using aql register the UDF Module.
aql> register module 'setname.lua' OK, 1 module added.
Step 3:
Get the setname using aql executing the UDF module lua function get.
NOTE: For the correct DIGEST value you will need to remove the 0x that preceeds the hash value.
aql> execute setname.get() on test where DIGEST="AE6A515F37DE4ADACC4496E2DA1FEA848C3A9270" +--------+ | get | +--------+ | "demo" | +--------+ 1 row in set (0.001 secs) OK
Notes
- AQL – UDF Management documentation is located here: UDF Management | Aerospike Documentation
- UDF API for database record: https://www.aerospike.com/docs/udf/api/record.html