| 5531 | } |
| 5532 | |
| 5533 | static void propagateMasterStaleKeys() |
| 5534 | { |
| 5535 | listIter li; |
| 5536 | listNode *ln; |
| 5537 | listRewind(g_pserver->masters, &li); |
| 5538 | robj *rgobj[2]; |
| 5539 | |
| 5540 | rgobj[0] = createEmbeddedStringObject("DEL", 3); |
| 5541 | |
| 5542 | while ((ln = listNext(&li)) != nullptr) |
| 5543 | { |
| 5544 | redisMaster *mi = (redisMaster*)listNodeValue(ln); |
| 5545 | if (mi->staleKeyMap != nullptr) |
| 5546 | { |
| 5547 | if (mi->master != nullptr) |
| 5548 | { |
| 5549 | for (auto &pair : *mi->staleKeyMap) |
| 5550 | { |
| 5551 | if (pair.second.empty()) |
| 5552 | continue; |
| 5553 | |
| 5554 | client *replica = replicaFromMaster(mi); |
| 5555 | if (replica == nullptr) |
| 5556 | continue; |
| 5557 | |
| 5558 | for (auto &spkey : pair.second) |
| 5559 | { |
| 5560 | rgobj[1] = spkey.get(); |
| 5561 | replicationFeedSlave(replica, pair.first, rgobj, 2, false); |
| 5562 | } |
| 5563 | } |
| 5564 | delete mi->staleKeyMap; |
| 5565 | mi->staleKeyMap = nullptr; |
| 5566 | } |
| 5567 | } |
| 5568 | } |
| 5569 | |
| 5570 | decrRefCount(rgobj[0]); |
| 5571 | } |
| 5572 | |
| 5573 | void replicationNotifyLoadedKey(redisDb *db, robj_roptr key, robj_roptr val, long long expire) { |
| 5574 | if (!g_pserver->fActiveReplica || listLength(g_pserver->slaves) == 0) |
no test coverage detected