Return the replica replication offset for this instance, that is * the offset for which we already processed the master replication stream. */
| 4734 | /* Return the replica replication offset for this instance, that is |
| 4735 | * the offset for which we already processed the master replication stream. */ |
| 4736 | long long replicationGetSlaveOffset(redisMaster *mi) { |
| 4737 | long long offset = 0; |
| 4738 | |
| 4739 | if (mi != NULL && mi->masterhost != NULL) { |
| 4740 | if (mi->master) { |
| 4741 | offset = mi->master->reploff; |
| 4742 | } else if (mi->cached_master) { |
| 4743 | offset = mi->cached_master->reploff; |
| 4744 | } |
| 4745 | } |
| 4746 | /* offset may be -1 when the master does not support it at all, however |
| 4747 | * this function is designed to return an offset that can express the |
| 4748 | * amount of data processed by the master, so we return a positive |
| 4749 | * integer. */ |
| 4750 | if (offset < 0) offset = 0; |
| 4751 | return offset; |
| 4752 | } |
| 4753 | |
| 4754 | /* --------------------------- REPLICATION CRON ---------------------------- */ |
| 4755 |
no outgoing calls
no test coverage detected