How to return the set name of a record using its digest

The Aerospike Knowledge Base has moved to https://support.aerospike.com. Content on https://discuss.aerospike.com is being migrated to either https://support.aerospike.com or https://docs.aerospike.com. Maintenance on articles stored in this repository ceased on December 31st 2022 and this article may be stale. If you have any questions, please do not hesitate to raise a case via https://support.aerospike.com.

FAQ How to return the Set name using the Digest

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

Keywords

SET NAME SETNAME DIGEST UDF LUA RECORD

Timestamp

05/22/2018