Return the slave replication offset for this instance, that is * the offset for which we already processed the master replication stream. */
| 3266 | /* Return the slave replication offset for this instance, that is |
| 3267 | * the offset for which we already processed the master replication stream. */ |
| 3268 | long long replicationGetSlaveOffset(void) { |
| 3269 | long long offset = 0; |
| 3270 | |
| 3271 | if (server.masterhost != NULL) { |
| 3272 | if (server.master) { |
| 3273 | offset = server.master->reploff; |
| 3274 | } else if (server.cached_master) { |
| 3275 | offset = server.cached_master->reploff; |
| 3276 | } |
| 3277 | } |
| 3278 | /* offset may be -1 when the master does not support it at all, however |
| 3279 | * this function is designed to return an offset that can express the |
| 3280 | * amount of data processed by the master, so we return a positive |
| 3281 | * integer. */ |
| 3282 | if (offset < 0) offset = 0; |
| 3283 | return offset; |
| 3284 | } |
| 3285 | |
| 3286 | /* --------------------------- REPLICATION CRON ---------------------------- */ |
| 3287 |
no outgoing calls
no test coverage detected