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

Function replicationGetSlaveOffset

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

Return the slave replication offset for this instance, that is * the offset for which we already processed the master replication stream. */

Source from the content-addressed store, hash-verified

3266/* Return the slave replication offset for this instance, that is
3267 * the offset for which we already processed the master replication stream. */
3268long 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

Callers 4

clusterBuildMessageHdrFunction · 0.85
clusterGetSlaveRankFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected