Free a cached master, called when there are no longer the conditions for * a partial resync on reconnection. */
| 4433 | /* Free a cached master, called when there are no longer the conditions for |
| 4434 | * a partial resync on reconnection. */ |
| 4435 | void replicationDiscardCachedMaster(redisMaster *mi) { |
| 4436 | if (mi->cached_master == NULL) return; |
| 4437 | |
| 4438 | serverLog(LL_NOTICE,"Discarding previously cached master state."); |
| 4439 | mi->cached_master->flags &= ~CLIENT_MASTER; |
| 4440 | freeClientAsync(mi->cached_master); |
| 4441 | mi->cached_master = NULL; |
| 4442 | } |
| 4443 | |
| 4444 | /* Turn the cached master into the current master, using the file descriptor |
| 4445 | * passed as argument as the socket for the new master. |
no test coverage detected