MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / rdbCheckError

Function rdbCheckError

src/redis-check-rdb.cpp:105–129  ·  view source on GitHub ↗

Called on RDB errors. Provides details about the RDB and the offset * we were when the error was detected. */

Source from the content-addressed store, hash-verified

103/* Called on RDB errors. Provides details about the RDB and the offset
104 * we were when the error was detected. */
105void rdbCheckError(const char *fmt, ...) {
106 char msg[1024];
107 va_list ap;
108
109 va_start(ap, fmt);
110 vsnprintf(msg, sizeof(msg), fmt, ap);
111 va_end(ap);
112
113 printf("--- RDB ERROR DETECTED ---\n");
114 printf("[offset %llu] %s\n",
115 (unsigned long long) (rdbstate.rio ?
116 rdbstate.rio->processed_bytes : 0), msg);
117 printf("[additional info] While doing: %s\n",
118 rdb_check_doing_string[rdbstate.doing]);
119 if (rdbstate.key)
120 printf("[additional info] Reading key '%s'\n",
121 (char*)ptrFromObj(rdbstate.key));
122 if (rdbstate.key_type != -1)
123 printf("[additional info] Reading type %d (%s)\n",
124 rdbstate.key_type,
125 ((unsigned)rdbstate.key_type <
126 sizeof(rdb_type_string)/sizeof(char*)) ?
127 rdb_type_string[rdbstate.key_type] : "unknown");
128 rdbShowGenericInfo();
129}
130
131/* Print informations during RDB checking. */
132void rdbCheckInfo(const char *fmt, ...) {

Callers 3

rdbReportErrorFunction · 0.85
rdbCheckHandleCrashFunction · 0.85
redis_check_rdbFunction · 0.85

Calls 2

ptrFromObjFunction · 0.85
rdbShowGenericInfoFunction · 0.85

Tested by

no test coverage detected