UDF development background
I was using Aerospike 3.5.12. Initially, I wrote UDFs remotely, then registered it to Aerospike via the Java client's UDF registration method. This method was a little cumbersome (it required re-registration for every change), but worked.
Later, I found it more convenient to directly edit the file on the Aerospike server, at /aerospike_dir/usr/udf/lua/myUdf.lua. This worked conveniently. Changes made were permanent and remained even upon cluster restart (if I recall correctly).
Recently, I upgraded to 3.6.1. I found that changes made directly to /aerospike_dir/usr/udf/lua/myUdf.lua are recognized by Aerospike until the cluster is restarted. After restart, all changes are lost, and the file reverts to its original version.
Question
Is this normal behavior? How can I disable this auto-reversion? Or, if I'm not developing UDFs correctly, how should I approach it?
You should not be directly editing the file maintained at "/opt/aerospike/usr/udf/lua". You should always go via the registration mechanism. Its cumbersome during initial development. But once the development stabilizes, you wouldnt be rolling out changes to your lua file that frequently. There are multiple reasons to not edit the file directly.