Modules: defrag CB should take robj, not sds (#13627)

Added a log of the keyname in the test modules to reproduce the problem
(tests crash without the fix)
This commit is contained in:
guybe7
2024-10-30 17:32:51 +08:00
committed by GitHub
parent 6437d07b03
commit ded8d993b7
2 changed files with 8 additions and 4 deletions
+2 -1
View File
@@ -161,13 +161,14 @@ size_t FragFreeEffort(RedisModuleString *key, const void *value) {
}
int FragDefrag(RedisModuleDefragCtx *ctx, RedisModuleString *key, void **value) {
REDISMODULE_NOT_USED(key);
unsigned long i = 0;
int steps = 0;
int dbid = RedisModule_GetDbIdFromDefragCtx(ctx);
RedisModule_Assert(dbid != -1);
RedisModule_Log(NULL, "notice", "Defrag key: %s", RedisModule_StringPtrLen(key, NULL));
/* Attempt to get cursor, validate it's what we're exepcting */
if (RedisModule_DefragCursorGet(ctx, &i) == REDISMODULE_OK) {
if (i > 0) datatype_resumes++;