Return the number of slaves that already acknowledged the specified * replication offset. */
| 3166 | /* Return the number of slaves that already acknowledged the specified |
| 3167 | * replication offset. */ |
| 3168 | int 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). */ |
no test coverage detected