I have a custom C++ module traMap.so
that is loaded and works fine in my Memgraph Platform setup. After making some changes to it, rebuilding it, and trying to reload it using mg.load("traMap")
, I find that despite the reloading process indicating success, the function calls still run the old code and not the updated one.
It seems like the module isn't really reloaded. I have placed the .so
file in /usr/lib/memgraph/query_modules
as I believe that's where it should be according to the --query-modules-directory
setting which I haven't changed. Is there any step I'm missing to ensure the updated module is loaded?
The issue you're facing can be related to how Linux handles file references by running processes. The running Memgraph process still references the old file. New processes that openes the file will get the new content.
Try this two options:
Delete the old .so file, then copy over the new file before calling
mg.load
. The old file reference will be removed, and the new file is loaded as expected whenmg.load
is called.Use the
install
command to place the new file. Theinstall
command is a basic Linux command used to copy files and set attributes. Here's how you might use theinstall
command to copy over your updated.so
file:EDIT: I've done some more digging. This is maybe also a bug according to this GitHub issue https://github.com/memgraph/mage/issues/381.