MCPcopy Create free account
hub / github.com/F-Stack/f-stack / deleteExpiredKeyAndPropagate

Function deleteExpiredKeyAndPropagate

app/redis-6.2.6/src/db.c:1442–1455  ·  view source on GitHub ↗

Delete the specified expired key and propagate expire. */

Source from the content-addressed store, hash-verified

1440
1441/* Delete the specified expired key and propagate expire. */
1442void deleteExpiredKeyAndPropagate(redisDb *db, robj *keyobj) {
1443 mstime_t expire_latency;
1444 latencyStartMonitor(expire_latency);
1445 if (server.lazyfree_lazy_expire)
1446 dbAsyncDelete(db,keyobj);
1447 else
1448 dbSyncDelete(db,keyobj);
1449 latencyEndMonitor(expire_latency);
1450 latencyAddSampleIfNeeded("expire-del",expire_latency);
1451 notifyKeyspaceEvent(NOTIFY_EXPIRED,"expired",keyobj,db->id);
1452 signalModifiedKey(NULL, db, keyobj);
1453 propagateExpire(db,keyobj,server.lazyfree_lazy_expire);
1454 server.stat_expiredkeys++;
1455}
1456
1457/* Propagate expires into slaves and the AOF file.
1458 * When a key expires in the master, a DEL operation for this key is sent

Callers 2

expireIfNeededFunction · 0.85

Calls 5

dbAsyncDeleteFunction · 0.85
dbSyncDeleteFunction · 0.85
notifyKeyspaceEventFunction · 0.85
signalModifiedKeyFunction · 0.85
propagateExpireFunction · 0.85

Tested by

no test coverage detected