Return the number of slaves that already acknowledged the specified * replication offset. */
| 4633 | /* Return the number of slaves that already acknowledged the specified |
| 4634 | * replication offset. */ |
| 4635 | int replicationCountAcksByOffset(long long offset) { |
| 4636 | listIter li; |
| 4637 | listNode *ln; |
| 4638 | int count = 0; |
| 4639 | |
| 4640 | listRewind(g_pserver->slaves,&li); |
| 4641 | while((ln = listNext(&li))) { |
| 4642 | client *replica = (client*)ln->value; |
| 4643 | |
| 4644 | if (replica->replstate != SLAVE_STATE_ONLINE) continue; |
| 4645 | if ((replica->repl_ack_off) >= offset) count++; |
| 4646 | } |
| 4647 | return count; |
| 4648 | } |
| 4649 | |
| 4650 | /* WAIT for N replicas to acknowledge the processing of our latest |
| 4651 | * write command (and all the previous commands). */ |
no test coverage detected