A RESP NULL is sent to indicate that all keys are invalid */
| 417 | |
| 418 | /* A RESP NULL is sent to indicate that all keys are invalid */ |
| 419 | void 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 |
no test coverage detected