Fix module loading failure for redis module#3374
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## unstable #3374 +/- ##
============================================
+ Coverage 76.68% 76.92% +0.24%
============================================
Files 162 162
Lines 80729 80729
============================================
+ Hits 61903 62098 +195
+ Misses 18826 18631 -195 🚀 New features to boost your workflow:
|
|
@roshkhatri How did you test it ? |
|
I tested this by loading a the minimal module that is mentioned on the issue #547 |
|
@roshkhatri Shall we add it as a test then ? I believe this would be useful for folks to load a Redis compatible module to Valkey if other API(s) are available. |
Signed-off-by: Roshan Khatri <rvkhatri@amazon.com>
Probably added by mistake during some merge of valkey-io#1566 Signed-off-by: Ran Shidlansik <ranshid@amazon.com> Signed-off-by: Roshan Khatri <rvkhatri@amazon.com>
Signed-off-by: Roshan Khatri <rvkhatri@amazon.com>
09c8807 to
1ab5be0
Compare
Signed-off-by: Roshan Khatri <rvkhatri@amazon.com>
PingXie
left a comment
There was a problem hiding this comment.
Lgtm. One nit on the makefile rule.
| 32bit: | ||
| $(MAKE) CFLAGS="-m32" LDFLAGS="-m32" | ||
|
|
||
| %.xo: %.c ../../src/valkeymodule.h |
There was a problem hiding this comment.
We should add a rule to have this new test module file depend on redismodule.h
hellovalkey is the only test module that includes redismodule.h. The generic %.xo pattern rule only tracks valkeymodule.h, so changes to redismodule.h would not trigger a rebuild of hellovalkey.xo, defeating the purpose of this regression test for valkey-io#547. Addresses review comment from @PingXie. Signed-off-by: Roshan Khatri <rvkhatri@amazon.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughRemoves the RedisModule_OnLoad macro alias from the public header and documents that the server supports both ValkeyModule_OnLoad and RedisModule_OnLoad. Adds a test module (hellovalkey) with a version script and Makefile rules, and a unit test that loads and unloads the module verifying the RedisModule_OnLoad path. ChangesLegacy module symbol support
🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@PingXie can you please merge this? |
|
@roshkhatri there is a test failure? |
|
Its not related to the code: connection issue with GitHub and the artifacts, you can rerun this test o see if it passes |
|
@PingXie all tests passed |
Fixes #547
Fix module loading failure ([CRASH] If you have version.script file, make sure update Redis* to Valkey* #547) where modules using a GNU ld
version.scriptthat explicitly exportRedisModule_OnLoadfailed to load because the header remapped that symbol toValkeyModule_OnLoad.Remove the
#define RedisModule_OnLoad ValkeyModule_OnLoadmacro fromsrc/redismodule.hand add a comment explaining why theRedisModule_OnLoadentry-point must remain unmapped, while keeping server compatibility sincevalkey-serverprobes bothValkeyModule_OnLoadandRedisModule_OnLoad.Test by loading this minimal module hellovalkey.zip and the steps mentioned in the issue [CRASH] If you have version.script file, make sure update Redis* to Valkey* #547