parent
c19530bc71
commit
0bad00d049
@ -4264,6 +4264,12 @@ void moduleTypeNameByID(char *name, uint64_t moduleid) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Return the name of the module that owns the specified moduleType. */
|
||||||
|
const char *moduleTypeModuleName(moduleType *mt) {
|
||||||
|
if (!mt || !mt->module) return NULL;
|
||||||
|
return mt->module->name;
|
||||||
|
}
|
||||||
|
|
||||||
/* Create a copy of a module type value using the copy callback. If failed
|
/* Create a copy of a module type value using the copy callback. If failed
|
||||||
* or not supported, produce an error reply and return NULL.
|
* or not supported, produce an error reply and return NULL.
|
||||||
*/
|
*/
|
||||||
|
13
src/rdb.c
13
src/rdb.c
@ -2176,16 +2176,17 @@ robj *rdbLoadObject(int rdbtype, rio *rdb, sds key) {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
moduleType *mt = moduleTypeLookupModuleByID(moduleid);
|
moduleType *mt = moduleTypeLookupModuleByID(moduleid);
|
||||||
char name[10];
|
|
||||||
|
|
||||||
if (rdbCheckMode && rdbtype == RDB_TYPE_MODULE_2) {
|
if (rdbCheckMode && rdbtype == RDB_TYPE_MODULE_2) {
|
||||||
|
char name[10];
|
||||||
moduleTypeNameByID(name,moduleid);
|
moduleTypeNameByID(name,moduleid);
|
||||||
return rdbLoadCheckModuleValue(rdb,name);
|
return rdbLoadCheckModuleValue(rdb,name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mt == NULL) {
|
if (mt == NULL) {
|
||||||
|
char name[10];
|
||||||
moduleTypeNameByID(name,moduleid);
|
moduleTypeNameByID(name,moduleid);
|
||||||
rdbReportCorruptRDB("The RDB file contains module data I can't load: no matching module '%s'", name);
|
rdbReportCorruptRDB("The RDB file contains module data I can't load: no matching module type '%s'", name);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
RedisModuleIO io;
|
RedisModuleIO io;
|
||||||
@ -2212,7 +2213,8 @@ robj *rdbLoadObject(int rdbtype, rio *rdb, sds key) {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (eof != RDB_MODULE_OPCODE_EOF) {
|
if (eof != RDB_MODULE_OPCODE_EOF) {
|
||||||
rdbReportCorruptRDB("The RDB file contains module data for the module '%s' that is not terminated by the proper module value EOF marker", name);
|
rdbReportCorruptRDB("The RDB file contains module data for the module '%s' that is not terminated by "
|
||||||
|
"the proper module value EOF marker", moduleTypeModuleName(mt));
|
||||||
if (ptr) {
|
if (ptr) {
|
||||||
o = createModuleObject(mt,ptr); /* creating just in order to easily destroy */
|
o = createModuleObject(mt,ptr); /* creating just in order to easily destroy */
|
||||||
decrRefCount(o);
|
decrRefCount(o);
|
||||||
@ -2222,8 +2224,9 @@ robj *rdbLoadObject(int rdbtype, rio *rdb, sds key) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ptr == NULL) {
|
if (ptr == NULL) {
|
||||||
moduleTypeNameByID(name,moduleid);
|
rdbReportCorruptRDB("The RDB file contains module data for the module type '%s', that the responsible "
|
||||||
rdbReportCorruptRDB("The RDB file contains module data for the module type '%s', that the responsible module is not able to load. Check for modules log above for additional clues.", name);
|
"module is not able to load. Check for modules log above for additional clues.",
|
||||||
|
moduleTypeModuleName(mt));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
o = createModuleObject(mt,ptr);
|
o = createModuleObject(mt,ptr);
|
||||||
|
@ -1744,6 +1744,7 @@ void moduleLoadFromQueue(void);
|
|||||||
int moduleGetCommandKeysViaAPI(struct redisCommand *cmd, robj **argv, int argc, getKeysResult *result);
|
int moduleGetCommandKeysViaAPI(struct redisCommand *cmd, robj **argv, int argc, getKeysResult *result);
|
||||||
moduleType *moduleTypeLookupModuleByID(uint64_t id);
|
moduleType *moduleTypeLookupModuleByID(uint64_t id);
|
||||||
void moduleTypeNameByID(char *name, uint64_t moduleid);
|
void moduleTypeNameByID(char *name, uint64_t moduleid);
|
||||||
|
const char *moduleTypeModuleName(moduleType *mt);
|
||||||
void moduleFreeContext(struct RedisModuleCtx *ctx);
|
void moduleFreeContext(struct RedisModuleCtx *ctx);
|
||||||
void unblockClientFromModule(client *c);
|
void unblockClientFromModule(client *c);
|
||||||
void moduleHandleBlockedClients(void);
|
void moduleHandleBlockedClients(void);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user