Aeropsike 3.7.4 does not see changes in udf file

99 Views Asked by At


We have an aerospike cluster with 3 nodes (v. 3.7.4)
We encountered a problem with udf. We registered new version of udf file, but when we query we get the same results as before.
From the aql when we do show modules we see that the hash of the file has changed, for testing purposes I've added a new function to the same file, then in aql when I use aggregate with that new function it says that the function does not found. We removed the module, dropped the cache in each node, then registered module again, and nothing seems to help to solve the problem. Here is the screen:

asinfo -v build
3.7.4

aql> aggregate invoices_udf.filter_by_merchant('FOOD-CULTURA-ESENTAI') on dareco.invoices
2017-01-06 15:13:27 ERROR Lua Runtime Error: function not found
Error: (100) UDF: Execution Error 2 : function not found

aql> show modules
+--------------------------------------------+---------------------+-------+
| hash                                       | module              | type  |
+--------------------------------------------+---------------------+-------+
| "18092674658a4edb345acd1e44941755ab962db1" | "statistics.lua"    | "lua" |
| "95357d821687372af7d9d8d3f8cc591df5ccfee3" | "invoices_udf.lua"  | "lua" |

We also tried to reload the cluster. Turned off the udf cache. Nothing helped.

2

There are 2 best solutions below

0
On

We have solved the problem by backing up the data, then restarting the cluster, importing data from the backup, recreating all the indices we had and deleting old unnecessary data.

0
On

For aggregations, your udf has to be loaded both on server nodes and client node. AQL will load it on the server node, so it works well for Record UDFs. For Aggregations, to load on client node, you should use the API call in the client to register the udf and also make sure when you connect to the cluster, in your connection configuration, you identify the lua user_path for the client node, ensure client userid has write access to that path, and system path for Aerospike lua modules to be loaded on the client node is also correctly identified in the connection config especially if using node.js or python clients. For details, see discussion at: https://discuss.aerospike.com/t/aerospikeerror-udf-execution-error-1/3801/13

(Posting this because restarting the cluster or rebuilding SIs is probably not related to your original aggregation issue.)