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

Function trackingInvalidateKeysOnFlush

app/redis-6.2.6/src/tracking.c:419–442  ·  view source on GitHub ↗

A RESP NULL is sent to indicate that all keys are invalid */

Source from the content-addressed store, hash-verified

417
418/* A RESP NULL is sent to indicate that all keys are invalid */
419void trackingInvalidateKeysOnFlush(int async) {
420 if (server.tracking_clients) {
421 listNode *ln;
422 listIter li;
423 listRewind(server.clients,&li);
424 while ((ln = listNext(&li)) != NULL) {
425 client *c = listNodeValue(ln);
426 if (c->flags & CLIENT_TRACKING) {
427 sendTrackingMessage(c,shared.null[c->resp]->ptr,sdslen(shared.null[c->resp]->ptr),1);
428 }
429 }
430 }
431
432 /* In case of FLUSHALL, reclaim all the memory used by tracking. */
433 if (TrackingTable) {
434 if (async) {
435 freeTrackingRadixTreeAsync(TrackingTable);
436 } else {
437 freeTrackingRadixTree(TrackingTable);
438 }
439 TrackingTable = raxNew();
440 TrackingTableTotalItems = 0;
441 }
442}
443
444/* Tracking forces Redis to remember information about which client may have
445 * certain keys. In workloads where there are a lot of reads, but keys are

Callers 1

signalFlushedDbFunction · 0.85

Calls 7

listRewindFunction · 0.85
listNextFunction · 0.85
sendTrackingMessageFunction · 0.85
sdslenFunction · 0.85
freeTrackingRadixTreeFunction · 0.85
raxNewFunction · 0.85

Tested by

no test coverage detected