MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / getReplIndexFromOffset

Function getReplIndexFromOffset

src/replication.cpp:252–256  ·  view source on GitHub ↗

Compute the corresponding index from a replication backlog offset * Since this computation needs the size of the replication backlog, * you need to have the repl_backlog_lock in order to call it */

Source from the content-addressed store, hash-verified

250 * Since this computation needs the size of the replication backlog,
251 * you need to have the repl_backlog_lock in order to call it */
252long long getReplIndexFromOffset(long long offset){
253 serverAssert(g_pserver->repl_backlog_lock.fOwnLock());
254 long long index = (offset - g_pserver->repl_backlog_start) % g_pserver->repl_backlog_size;
255 return index;
256}
257
258/* This function is called when the user modifies the replication backlog
259 * size at runtime. It is up to the function to both update the

Callers 2

resizeReplicationBacklogFunction · 0.85
writeToClientFunction · 0.85

Calls 1

fOwnLockMethod · 0.45

Tested by

no test coverage detected