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

Function flushSlaveKeysWithExpireList

src/expire.cpp:711–716  ·  view source on GitHub ↗

Remove the keys in the hash table. We need to do that when data is * flushed from the g_pserver-> We may receive new keys from the master with * the same name/db and it is no longer a good idea to expire them. * * Note: technically we should handle the case of a single DB being flushed * but it is not worth it since anyway race conditions using the same set * of key names in a writable repli

Source from the content-addressed store, hash-verified

709 * of key names in a writable replica and in its master will lead to
710 * inconsistencies. This is just a best-effort thing we do. */
711void flushSlaveKeysWithExpireList(void) {
712 if (slaveKeysWithExpire) {
713 dictRelease(slaveKeysWithExpire);
714 slaveKeysWithExpire = NULL;
715 }
716}
717
718int checkAlreadyExpired(long long when) {
719 /* EXPIRE with negative TTL, or EXPIREAT with a timestamp into the past

Callers 1

emptyDbFunction · 0.85

Calls 1

dictReleaseFunction · 0.70

Tested by

no test coverage detected