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