server persistence event handler
| 307 | |
| 308 | // server persistence event handler |
| 309 | static void _PersistenceEventHandler(RedisModuleCtx *ctx, RedisModuleEvent eid, |
| 310 | uint64_t subevent, void *data) { |
| 311 | if(INTERMEDIATE_GRAPHS) { |
| 312 | // check for half-baked graphs |
| 313 | // indicated by `aux_field_counter` > 0 |
| 314 | // in such case we do not want to either perform backup nor do we want to |
| 315 | // synchronize our replica, as such we're aborting by existing |
| 316 | // assuming we're running on a fork process |
| 317 | if(Globals_Get_ProcessIsChild()) { |
| 318 | // intermediate graph(s) detected, exit! |
| 319 | RedisModule_Log(NULL, REDISMODULE_LOGLEVEL_WARNING, |
| 320 | "RedisGraph - aborting BGSAVE, detected intermediate graph(s)"); |
| 321 | |
| 322 | exit(255); |
| 323 | } else { |
| 324 | // don't mess with the keyspace if we have half-baked graphs |
| 325 | return; |
| 326 | } |
| 327 | } |
| 328 | |
| 329 | if(_IsEventPersistenceStart(eid, subevent)) { |
| 330 | _CreateKeySpaceMetaKeys(ctx); |
| 331 | } else if(_IsEventPersistenceEnd(eid, subevent)) { |
| 332 | _ClearKeySpaceMetaKeys(ctx, false); |
| 333 | } |
| 334 | } |
| 335 | |
| 336 | // Perform clean-up upon server shutdown. |
| 337 | static void _ShutdownEventHandler |
nothing calls this directly
no test coverage detected