Skip to content

Commit

Permalink
ss
Browse files Browse the repository at this point in the history
Signed-off-by: Binbin <[email protected]>
  • Loading branch information
enjoy-binbin committed Dec 17, 2024
1 parent 980a801 commit db504dc
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/valkey-check-rdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ struct {
unsigned long keys; /* Number of keys processed. */
unsigned long expires; /* Number of keys with an expire. */
unsigned long already_expired; /* Number of keys already expired. */
unsigned long lua_scripts; /* Number of lua scripts. */
int doing; /* The state while reading the RDB. */
int error_set; /* True if error is populated. */
char error[1024];
Expand Down Expand Up @@ -108,6 +109,9 @@ void rdbShowGenericInfo(void) {
printf("[info] %lu keys read\n", rdbstate.keys);
printf("[info] %lu expires\n", rdbstate.expires);
printf("[info] %lu already expired\n", rdbstate.already_expired);
if (rdbstate.lua_scripts) {
printf("[info] %lu lua scripts read\n", rdbstate.lua_scripts);
}
}

/* Called on RDB errors. Provides details about the RDB and the offset
Expand Down Expand Up @@ -280,7 +284,13 @@ int redis_check_rdb(char *rdbfilename, FILE *fp) {
goto eoferr;
}

rdbCheckInfo("AUX FIELD %s = '%s'", (char *)auxkey->ptr, (char *)auxval->ptr);
if (!strcasecmp(auxkey->ptr, "lua")) {
/* We do not print the lua aux field in here, otherwise a large number of lua
* scripts will pollute the output. */
rdbstate.lua_scripts++;
} else {
rdbCheckInfo("AUX FIELD %s = '%s'", (char *)auxkey->ptr, (char *)auxval->ptr);
}
decrRefCount(auxkey);
decrRefCount(auxval);
continue; /* Read type again. */
Expand Down

0 comments on commit db504dc

Please sign in to comment.