summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSalvatore Sanfilippo <antirez@gmail.com>2020-02-28 10:22:53 +0100
committerGitHub <noreply@github.com>2020-02-28 10:22:53 +0100
commitf0d9a4e1a40714dc6ece98238217046950cb5d2e (patch)
tree35711e43c3cfde65f1cee6a93dd74f3a2c7123b0 /src
parentd4e375fc1eb6a2e1bc26f3c853ec63c5ab569ed9 (diff)
parent6fff2cf9b65effe2846d8383afa32dc0b04dd149 (diff)
downloadredis-f0d9a4e1a40714dc6ece98238217046950cb5d2e.tar.gz
Merge pull request #6893 from oranagra/api_doc_aux_save
module api docs for aux_save and aux_load
Diffstat (limited to 'src')
-rw-r--r--src/module.c6
-rw-r--r--src/rdb.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/src/module.c b/src/module.c
index cce3d1c11..17af5336e 100644
--- a/src/module.c
+++ b/src/module.c
@@ -3529,6 +3529,8 @@ void moduleTypeNameByID(char *name, uint64_t moduleid) {
* // Optional fields
* .digest = myType_DigestCallBack,
* .mem_usage = myType_MemUsageCallBack,
+ * .aux_load = myType_AuxRDBLoadCallBack,
+ * .aux_save = myType_AuxRDBSaveCallBack,
* }
*
* * **rdb_load**: A callback function pointer that loads data from RDB files.
@@ -3536,6 +3538,10 @@ void moduleTypeNameByID(char *name, uint64_t moduleid) {
* * **aof_rewrite**: A callback function pointer that rewrites data as commands.
* * **digest**: A callback function pointer that is used for `DEBUG DIGEST`.
* * **free**: A callback function pointer that can free a type value.
+ * * **aux_save**: A callback function pointer that saves out of keyspace data to RDB files.
+ * 'when' argument is either REDISMODULE_AUX_BEFORE_RDB or REDISMODULE_AUX_AFTER_RDB.
+ * * **aux_load**: A callback function pointer that loads out of keyspace data from RDB files.
+ * Similar to aux_save, returns REDISMODULE_OK on success, and ERR otherwise.
*
* The **digest* and **mem_usage** methods should currently be omitted since
* they are not yet implemented inside the Redis modules core.
diff --git a/src/rdb.c b/src/rdb.c
index 61265433d..cbcea96c6 100644
--- a/src/rdb.c
+++ b/src/rdb.c
@@ -2195,7 +2195,7 @@ int rdbLoadRio(rio *rdb, int rdbflags, rdbSaveInfo *rsi) {
io.ver = 2;
/* Call the rdb_load method of the module providing the 10 bit
* encoding version in the lower 10 bits of the module ID. */
- if (mt->aux_load(&io,moduleid&1023, when) || io.error) {
+ if (mt->aux_load(&io,moduleid&1023, when) != REDISMODULE_OK || io.error) {
moduleTypeNameByID(name,moduleid);
serverLog(LL_WARNING,"The RDB file contains module AUX data for the module type '%s', that the responsible module is not able to load. Check for modules log above for additional clues.", name);
exit(1);