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

Function replicationCountAcksByOffset

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

Return the number of slaves that already acknowledged the specified * replication offset. */

Source from the content-addressed store, hash-verified

3166/* Return the number of slaves that already acknowledged the specified
3167 * replication offset. */
3168int replicationCountAcksByOffset(long long offset) {
3169 listIter li;
3170 listNode *ln;
3171 int count = 0;
3172
3173 listRewind(server.slaves,&li);
3174 while((ln = listNext(&li))) {
3175 client *slave = ln->value;
3176
3177 if (slave->replstate != SLAVE_STATE_ONLINE) continue;
3178 if (slave->repl_ack_off >= offset) count++;
3179 }
3180 return count;
3181}
3182
3183/* WAIT for N replicas to acknowledge the processing of our latest
3184 * write command (and all the previous commands). */

Callers 3

waitCommandFunction · 0.85

Calls 2

listRewindFunction · 0.85
listNextFunction · 0.85

Tested by

no test coverage detected