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

Function streamPropagateGroupID

app/redis-6.2.6/src/t_stream.c:1411–1425  ·  view source on GitHub ↗

We need this when we want to propoagate the new last-id of a consumer group * that was consumed by XREADGROUP with the NOACK option: in that case we can't * propagate the last ID just using the XCLAIM LASTID option, so we emit * * XGROUP SETID */

Source from the content-addressed store, hash-verified

1409 * XGROUP SETID <key> <groupname> <id>
1410 */
1411void streamPropagateGroupID(client *c, robj *key, streamCG *group, robj *groupname) {
1412 robj *argv[5];
1413 argv[0] = shared.xgroup;
1414 argv[1] = shared.setid;
1415 argv[2] = key;
1416 argv[3] = groupname;
1417 argv[4] = createObjectFromStreamID(&group->last_id);
1418
1419 /* We use progagate() because this code path is not always called from
1420 * the command execution context. Moreover this will just alter the
1421 * consumer group state, and we don't need MULTI/EXEC wrapping because
1422 * there is no message state cross-message atomicity required. */
1423 propagate(server.xgroupCommand,c->db->id,argv,5,PROPAGATE_AOF|PROPAGATE_REPL);
1424 decrRefCount(argv[4]);
1425}
1426
1427/* We need this when we want to propagate creation of consumer that was created
1428 * by XREADGROUP with the NOACK option. In that case, the only way to create

Callers 2

streamReplyWithRangeFunction · 0.85
xclaimCommandFunction · 0.85

Calls 3

createObjectFromStreamIDFunction · 0.85
propagateFunction · 0.85
decrRefCountFunction · 0.85

Tested by

no test coverage detected