Skip to content

Adding server.call/pcall option to LUA scripting. (#136)#213

Merged
madolson merged 5 commits into
valkey-io:unstablefrom
parthpatel:unstable
Apr 6, 2024
Merged

Adding server.call/pcall option to LUA scripting. (#136)#213
madolson merged 5 commits into
valkey-io:unstablefrom
parthpatel:unstable

Conversation

@parthpatel

@parthpatel parthpatel commented Apr 4, 2024

Copy link
Copy Markdown
Contributor

This commit does not remove redis.call/pcall just yet. It also does not rename Redis in error messages such as "Please specify at least one argument for this redis lib call". This allows users to maintain full backwards compatibility while introducing an option to use server.call for new code.

I verified that the unit tests pass. Also manually verified that the redis-server responds to server.call invocations within lua scripting. Also verified that function registration works as expected.

[ok]: EVAL - is Lua able to call Redis API? (0 ms)
[ok]: EVAL - is Lua able to call Server API? (1 ms)
[ok]: EVAL - No arguments to redis.call/pcall is considered an error (0 ms)
[ok]: EVAL - No arguments to server.call/pcall is considered an error (1 ms)

Comment thread src/script_lua.c Outdated
Comment thread src/script_lua.c Outdated
Comment thread tests/unit/scripting.tcl Outdated
Comment thread tests/unit/scripting.tcl Outdated
Comment thread tests/unit/scripting.tcl Outdated
Comment thread src/eval.c
This commit does not remove redis.call/pcall just yet. It also does not rename Redis in error messages such as "Please specify at least one argument for this redis lib call". This allows users to maintain full backwards compatibility while introducing an option to use server.call for new code.

Signed-off-by: Parth Patel <661497+parthpatel@users.noreply.github.com>
@parthpatel parthpatel assigned parthpatel and madolson and unassigned parthpatel Apr 4, 2024
@parthpatel parthpatel added the rebranding Valkey is not Redis label Apr 4, 2024
Comment thread src/script_lua.c Outdated
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Comment thread tests/unit/scripting.tcl Outdated

@madolson madolson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The server.register_function are also not working as expected. I'm working on a better way to test all the compatibility atm.

Comment thread src/eval.c Outdated
Comment thread tests/unit/scripting.tcl Outdated
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Comment thread tests/unit/scripting.tcl Outdated
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
@madolson madolson requested review from hpatro and zuiderkwast April 5, 2024 01:58
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
@madolson madolson merged commit 620d325 into valkey-io:unstable Apr 6, 2024
madolson added a commit to madolson/valkey that referenced this pull request Apr 7, 2024
…lkey-io#213)

This commit does not remove redis.call/pcall just yet. It also does not
rename Redis in error messages such as "Please specify at least one
argument for this redis lib call". This allows users to maintain full
backwards compatibility while introducing an option to use server.call
for new code.

I verified that the unit tests pass. Also manually verified that the
redis-server responds to server.call invocations within lua scripting.
Also verified that function registration works as expected.

```
[ok]: EVAL - is Lua able to call Redis API? (0 ms)
[ok]: EVAL - is Lua able to call Server API? (1 ms)
[ok]: EVAL - No arguments to redis.call/pcall is considered an error (0 ms)
[ok]: EVAL - No arguments to server.call/pcall is considered an error (1 ms)
```

---------

Signed-off-by: Parth Patel <661497+parthpatel@users.noreply.github.com>
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Co-authored-by: Madelyn Olson <madelyneolson@gmail.com>
@zuiderkwast zuiderkwast linked an issue Apr 10, 2024 that may be closed by this pull request
PatrickJS pushed a commit to PatrickJS/placeholderkv that referenced this pull request Apr 24, 2024
…lkey-io#213)

This commit does not remove redis.call/pcall just yet. It also does not
rename Redis in error messages such as "Please specify at least one
argument for this redis lib call". This allows users to maintain full
backwards compatibility while introducing an option to use server.call
for new code.

I verified that the unit tests pass. Also manually verified that the
redis-server responds to server.call invocations within lua scripting.
Also verified that function registration works as expected.

```
[ok]: EVAL - is Lua able to call Redis API? (0 ms)
[ok]: EVAL - is Lua able to call Server API? (1 ms)
[ok]: EVAL - No arguments to redis.call/pcall is considered an error (0 ms)
[ok]: EVAL - No arguments to server.call/pcall is considered an error (1 ms)
```

---------

Signed-off-by: Parth Patel <661497+parthpatel@users.noreply.github.com>
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Co-authored-by: Madelyn Olson <madelyneolson@gmail.com>
HLFH pushed a commit to HLFH/searxng that referenced this pull request May 28, 2025
return42 pushed a commit to return42/searxng that referenced this pull request Jun 24, 2025
return42 pushed a commit to return42/searxng that referenced this pull request Jun 25, 2025
return42 pushed a commit to return42/searxng that referenced this pull request Jun 28, 2025
return42 pushed a commit to return42/searxng that referenced this pull request Jun 29, 2025
return42 pushed a commit to return42/searxng that referenced this pull request Jun 30, 2025
return42 pushed a commit to return42/searxng that referenced this pull request Jul 1, 2025
For backward compatibility to old (existing) Redis DB

- searxng#4795 (comment)

Related to issue

- valkey-io/valkey#136 and
- PR valkey-io/valkey#213
return42 pushed a commit to HLFH/searxng that referenced this pull request Jul 8, 2025
For backward compatibility to old (existing) Redis DB

- searxng#4795 (comment)

Related to issue

- valkey-io/valkey#136 and
- PR valkey-io/valkey#213
bjosv added a commit to bjosv/valkey that referenced this pull request Aug 20, 2025
Squashed 'deps/libvalkey/' changes from abcd27fbf..d95a5ee9a

9e10acbf7 Fix duplicate Acks for RDMA events. (valkey-io#229)
1eadedf48 Remove the unused valDup API from dict
a449f0ea1 Don't expose internal functions in shared libraries (valkey-io#205)
178e350c7 Cluster code cleanup (valkey-io#216)
4020396c8 Fix `unused-parameter` warning when building with `NDEBUG` (valkey-io#212)
279125e22 Spelling (valkey-io#213)
99aa158bc Use existing connections for blocking slotmap updates (valkey-io#199)
f670346b9 Only install headers for `TLS` and `RDMA` when enabled in CMake (valkey-io#206)
41c5911f1 Remove macro UNUSED from public API (valkey-io#200)
969a8c546 Fix dependency issue with RDMA (valkey-io#201)

git-subtree-dir: deps/libvalkey
git-subtree-split: d95a5ee9ad95b9ee7f298f38d0fb93f3f7659ef7

Signed-off-by: Björn Svensson <bjorn.a.svensson@est.tech>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rebranding Valkey is not Redis

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Add Lua global object server as alias for redis

4 participants