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

Function replicationFeedSlavesFromMasterStream

app/redis-6.2.6/src/replication.c:355–377  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

353 * to our sub-slaves. */
354#include <ctype.h>
355void replicationFeedSlavesFromMasterStream(list *slaves, char *buf, size_t buflen) {
356 listNode *ln;
357 listIter li;
358
359 /* Debugging: this is handy to see the stream sent from master
360 * to slaves. Disabled with if(0). */
361 if (0) {
362 printf("%zu:",buflen);
363 for (size_t j = 0; j < buflen; j++) {
364 printf("%c", isprint(buf[j]) ? buf[j] : '.');
365 }
366 printf("\n");
367 }
368
369 if (server.repl_backlog) feedReplicationBacklog(buf,buflen);
370 listRewind(slaves,&li);
371 while((ln = listNext(&li))) {
372 client *slave = ln->value;
373
374 if (!canFeedReplicaReplBuffer(slave)) continue;
375 addReplyProto(slave,buf,buflen);
376 }
377}
378
379void replicationFeedMonitors(client *c, list *monitors, int dictid, robj **argv, int argc) {
380 if (!(listLength(server.monitors) && !server.loading)) return;

Callers 1

commandProcessedFunction · 0.85

Calls 7

isprintFunction · 0.85
feedReplicationBacklogFunction · 0.85
listRewindFunction · 0.85
listNextFunction · 0.85
canFeedReplicaReplBufferFunction · 0.85
addReplyProtoFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected