Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NEW] Move Lua scripting engine into an external Valkey module #1627

Open
rjd15372 opened this issue Jan 27, 2025 · 0 comments
Open

[NEW] Move Lua scripting engine into an external Valkey module #1627

rjd15372 opened this issue Jan 27, 2025 · 0 comments
Assignees

Comments

@rjd15372
Copy link
Contributor

The problem/use-case that the feature addresses

Currently the Lua scripting engine code is part of Valkey core engine binary, and this makes the following options difficult to achieve:

  1. Build Valkey without the Lua dependency
  2. Completely unload the Lua scripting engine from memory if we don't want to use it for EVAL/FCALL.
  3. Replace the Lua scripting engine present in the core, which currently uses Lua 5.1 interpreter, by a scripting engine that uses a more recent Lua interpreter.

Making the Lua scripting engine an external module enables the above options, in a straightforward way.
Point 1 is automatically achieved because the valkey core engine will not have any Lua code in it.
For point 2, we can just run the command MODULE UNLOAD <modulename> to unload the lua module.
And for point 3, we can unload the lua 5.1 module, and load the lua 5.3 module.

Description of the feature

The current Lua scripting engine code is built as an external module and the code adapted to make use of the Module API.

When the valkey server binary is built, we also build the the lua module, and the server code will automatically load the Lua module upon startup.

If a user does not want the Lua scripting engine to be automatically loaded, the user must set a new configuration option in valkey.conf to prevent the lua module from being loaded.

The release process must also be changed to install the lua module in the standard shared libraries directory of the OS, so that the valkey server can find it when it loads it on startup.

Related Issues and PRs

#1261
#1204
#1277
#1497

@rjd15372 rjd15372 self-assigned this Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant