MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / QueryCtx_UnlockCommit

Function QueryCtx_UnlockCommit

src/query_ctx.c:418–426  ·  view source on GitHub ↗

starts an ulocking flow and notifies Redis after commiting changes the only writer which allow to perform the unlock and commit (replicate) is the last_writer the method get an OpBase and compares it to the last writer, if they are equal then the commit and unlock flow will start Unlocking flow: 1. replicate 2. unlock graph R/W lock 3. close key 4. unlock GIL

Source from the content-addressed store, hash-verified

416// 3. close key
417// 4. unlock GIL
418void QueryCtx_UnlockCommit() {
419 QueryCtx *ctx = _QueryCtx_GetCtx();
420 if(!ctx) return;
421
422 // already unlocked?
423 if(!ctx->internal_exec_ctx.locked_for_commit) return;
424
425 _QueryCtx_UnlockCommit(ctx);
426}
427
428// replicate command to AOF/Replicas
429void QueryCtx_Replicate

Callers 1

_ExecuteQueryFunction · 0.85

Calls 2

_QueryCtx_GetCtxFunction · 0.85
_QueryCtx_UnlockCommitFunction · 0.85

Tested by

no test coverage detected