Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
b39636a
Adds consumer group lag
itamarhaber Jun 22, 2021
ec400e4
Aligns tests with unstable
itamarhaber Jun 22, 2021
522b224
Merge branch 'unstable' into stream-cglag
itamarhaber Jun 22, 2021
40547d9
Adds tests
itamarhaber Jun 22, 2021
11ad41c
Resolve warning
itamarhaber Jun 22, 2021
96489ab
Remove end_id from streamIsContiguous
itamarhaber Jun 23, 2021
a91c532
Check for empty stream
itamarhaber Jun 23, 2021
4bcf98a
Merge branch 'unstable' into stream-cglag
itamarhaber Jun 24, 2021
6d37ea7
Adds RDB support
itamarhaber Jun 25, 2021
e44ca20
Adds legacy persistence test
itamarhaber Jun 25, 2021
a111a57
Tests XSETID ... offset xdel_max_id
itamarhaber Jun 25, 2021
de78119
Removes copy-pasta dereference
itamarhaber Jun 27, 2021
fb1b4b8
Removes another c/p deref
itamarhaber Jun 27, 2021
fe42c9c
Avoids using a new serialization type for streams
itamarhaber Jun 29, 2021
a9ad10b
Adds call to rioGetReadError after reading cg offset
itamarhaber Jun 29, 2021
f80abc4
cmp relate to 0 & cleans some leftover comments
itamarhaber Jun 29, 2021
3b7dd3f
Comments, style and an assert
itamarhaber Jun 30, 2021
d901888
Undo line wrap
itamarhaber Jul 1, 2021
5bb4cbf
Supress 'uninitialized conditional jmp' valgrind warnings
itamarhaber Jul 1, 2021
7af9e2b
Maintains a first_id stream property
itamarhaber Jul 2, 2021
add848c
Renames streamGetOffset
itamarhaber Jul 4, 2021
c91eca5
Unifies into StreamGetEdgeID
itamarhaber Jul 4, 2021
2e26f5c
Extend stream iterator to include tombs
itamarhaber Jul 5, 2021
a678aca
Unwrap lines
itamarhaber Jul 5, 2021
4986e1f
Removes a superfluous OR
itamarhaber Jul 5, 2021
83d7c80
Update src/t_stream.c
itamarhaber Jul 6, 2021
6d0daeb
Renames a define
itamarhaber Aug 8, 2021
ecb59a7
Merge branch 'unstable' into stream-cglag
itamarhaber Sep 7, 2021
e0e0f19
Fixes corrupt stream payload test to fail early during restore
itamarhaber Sep 7, 2021
de543f3
Merge branch 'unstable' into stream-cglag
itamarhaber Sep 23, 2021
635178f
Merge branch 'unstable' into stream-cglag
itamarhaber Sep 26, 2021
d24d9f6
Fixes wrong number of args
itamarhaber Sep 27, 2021
2a579ed
Applies CR https://github.com/redis/redis/pull/9127\#discussion_r7287…
itamarhaber Nov 8, 2021
afb7412
Merge branch 'unstable' into stream-cglag
itamarhaber Nov 27, 2021
6ea72d1
Reverts carrying rdbver into rdbLoadObject
itamarhaber Nov 27, 2021
e29b089
Fixes arity of XGROUP SETID
itamarhaber Nov 28, 2021
94b00ac
Refactor into streamReplyWithCGLag
itamarhaber Nov 28, 2021
72a1015
Rewrite tests to use a dictionary instead of list
itamarhaber Nov 28, 2021
9f2e836
Adds lag and last-delivered-offset to XINFO GROUPS
itamarhaber Nov 28, 2021
5165321
Applies CR from @sundb and @guybe7
itamarhaber Dec 5, 2021
438a3be
Merge branch 'unstable' into stream-cglag
itamarhaber Dec 8, 2021
2643176
Changes name to streamRangeDoesNotContainTombstone
itamarhaber Feb 8, 2022
a7e3bae
Merge branch 'unstable' into stream-cglag
itamarhaber Feb 8, 2022
e8f42bd
Merge branch 'unstable' into stream-cglag
itamarhaber Feb 8, 2022
cb2796a
Post merge adjustments
itamarhaber Feb 8, 2022
03ade5b
Merge branch 'stream-cglag' of github.com:itamarhaber/redis into stre…
itamarhaber Feb 9, 2022
464bd1d
Applies more CR
itamarhaber Feb 9, 2022
32a506f
Command docs and tests
itamarhaber Feb 10, 2022
5d3aabd
Fixes XGROUP SETID and removes more offset term
itamarhaber Feb 10, 2022
3b28394
Update src/cluster.c
itamarhaber Feb 11, 2022
4563efb
More documentation fixes
itamarhaber Feb 11, 2022
f9c1d4a
Exposes `recorded-first-entry-id` for tests
itamarhaber Feb 16, 2022
9766a76
Uses ULLONG_MAX as invalid entries_read instead of 0
itamarhaber Feb 21, 2022
5f2ee81
Overhaul by @guybe7
itamarhaber Feb 23, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/aof.c
Original file line number Diff line number Diff line change
Expand Up @@ -2007,10 +2007,14 @@ int rewriteStreamObject(rio *r, robj *key, robj *o) {

/* Append XSETID after XADD, make sure lastid is correct,
* in case of XDEL lastid. */
if (!rioWriteBulkCount(r,'*',3) ||
if (!rioWriteBulkCount(r,'*',7) ||
!rioWriteBulkString(r,"XSETID",6) ||
!rioWriteBulkObject(r,key) ||
!rioWriteBulkStreamID(r,&s->last_id))
!rioWriteBulkStreamID(r,&s->last_id) ||
!rioWriteBulkString(r,"ENTRIESADDED",12) ||
!rioWriteBulkLongLong(r,s->entries_added) ||
!rioWriteBulkString(r,"MAXDELETEDID",12) ||
!rioWriteBulkStreamID(r,&s->max_deleted_entry_id))
{
streamIteratorStop(&si);
return 0;
Expand All @@ -2025,12 +2029,14 @@ int rewriteStreamObject(rio *r, robj *key, robj *o) {
while(raxNext(&ri)) {
streamCG *group = ri.data;
/* Emit the XGROUP CREATE in order to create the group. */
if (!rioWriteBulkCount(r,'*',5) ||
if (!rioWriteBulkCount(r,'*',7) ||
!rioWriteBulkString(r,"XGROUP",6) ||
!rioWriteBulkString(r,"CREATE",6) ||
!rioWriteBulkObject(r,key) ||
!rioWriteBulkString(r,(char*)ri.key,ri.key_len) ||
!rioWriteBulkStreamID(r,&group->last_id))
!rioWriteBulkStreamID(r,&group->last_id) ||
!rioWriteBulkString(r,"ENTRIESREAD",11) ||
!rioWriteBulkLongLong(r,group->entries_read))
{
raxStop(&ri);
streamIteratorStop(&si);
Expand Down
2 changes: 1 addition & 1 deletion src/cluster.c
Original file line number Diff line number Diff line change
Expand Up @@ -5703,7 +5703,7 @@ int verifyDumpPayload(unsigned char *p, size_t len, uint16_t *rdbver_ptr) {
if (len < 10) return C_ERR;
footer = p+(len-10);

/* Verify RDB version */
/* Set and verify RDB version. */
rdbver = (footer[1] << 8) | footer[0];
if (rdbver_ptr) {
*rdbver_ptr = rdbver;
Expand Down
39 changes: 29 additions & 10 deletions src/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -3404,7 +3404,7 @@ struct redisCommandArg FUNCTION_LOAD_Args[] = {
{"engine-name",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_NONE},
{"library-name",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_NONE},
{"replace",ARG_TYPE_PURE_TOKEN,-1,"REPLACE",NULL,NULL,CMD_ARG_OPTIONAL},
{"library-description",ARG_TYPE_STRING,-1,"DESC",NULL,NULL,CMD_ARG_OPTIONAL},
{"library-description",ARG_TYPE_STRING,-1,"DESCRIPTION",NULL,NULL,CMD_ARG_OPTIONAL},
{"function-code",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_NONE},
{0}
};
Expand Down Expand Up @@ -5992,7 +5992,10 @@ struct redisCommandArg XDEL_Args[] = {
/********** XGROUP CREATE ********************/

/* XGROUP CREATE history */
#define XGROUP_CREATE_History NULL
commandHistory XGROUP_CREATE_History[] = {
{"7.0.0","Added the `entries_read` named argument."},
{0}
};

/* XGROUP CREATE tips */
#define XGROUP_CREATE_tips NULL
Expand All @@ -6010,6 +6013,7 @@ struct redisCommandArg XGROUP_CREATE_Args[] = {
{"groupname",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_NONE},
{"id",ARG_TYPE_ONEOF,-1,NULL,NULL,NULL,CMD_ARG_NONE,.subargs=XGROUP_CREATE_id_Subargs},
{"mkstream",ARG_TYPE_PURE_TOKEN,-1,"MKSTREAM",NULL,NULL,CMD_ARG_OPTIONAL},
{"entries_read",ARG_TYPE_INTEGER,-1,"ENTRIESREAD",NULL,NULL,CMD_ARG_OPTIONAL},
{0}
};

Expand Down Expand Up @@ -6071,7 +6075,10 @@ struct redisCommandArg XGROUP_DESTROY_Args[] = {
/********** XGROUP SETID ********************/

/* XGROUP SETID history */
#define XGROUP_SETID_History NULL
commandHistory XGROUP_SETID_History[] = {
{"7.0.0","Added the optional `entries_read` argument."},
{0}
};

/* XGROUP SETID tips */
#define XGROUP_SETID_tips NULL
Expand All @@ -6088,6 +6095,7 @@ struct redisCommandArg XGROUP_SETID_Args[] = {
{"key",ARG_TYPE_KEY,0,NULL,NULL,NULL,CMD_ARG_NONE},
{"groupname",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_NONE},
{"id",ARG_TYPE_ONEOF,-1,NULL,NULL,NULL,CMD_ARG_NONE,.subargs=XGROUP_SETID_id_Subargs},
{"entries_read",ARG_TYPE_INTEGER,-1,"ENTRIESREAD",NULL,NULL,CMD_ARG_OPTIONAL},
{0}
};

Expand All @@ -6098,7 +6106,7 @@ struct redisCommand XGROUP_Subcommands[] = {
{"delconsumer","Delete a consumer from a consumer group.","O(1)","5.0.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_STREAM,XGROUP_DELCONSUMER_History,XGROUP_DELCONSUMER_tips,xgroupCommand,5,CMD_WRITE,ACL_CATEGORY_STREAM,{{NULL,CMD_KEY_RW|CMD_KEY_DELETE,KSPEC_BS_INDEX,.bs.index={2},KSPEC_FK_RANGE,.fk.range={0,1,0}}},.args=XGROUP_DELCONSUMER_Args},
{"destroy","Destroy a consumer group.","O(N) where N is the number of entries in the group's pending entries list (PEL).","5.0.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_STREAM,XGROUP_DESTROY_History,XGROUP_DESTROY_tips,xgroupCommand,4,CMD_WRITE,ACL_CATEGORY_STREAM,{{NULL,CMD_KEY_RW|CMD_KEY_DELETE,KSPEC_BS_INDEX,.bs.index={2},KSPEC_FK_RANGE,.fk.range={0,1,0}}},.args=XGROUP_DESTROY_Args},
{"help","Show helpful text about the different subcommands","O(1)","5.0.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_STREAM,XGROUP_HELP_History,XGROUP_HELP_tips,xgroupCommand,2,CMD_LOADING|CMD_STALE,ACL_CATEGORY_STREAM},
{"setid","Set a consumer group to an arbitrary last delivered ID value.","O(1)","5.0.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_STREAM,XGROUP_SETID_History,XGROUP_SETID_tips,xgroupCommand,5,CMD_WRITE,ACL_CATEGORY_STREAM,{{NULL,CMD_KEY_RW|CMD_KEY_UPDATE,KSPEC_BS_INDEX,.bs.index={2},KSPEC_FK_RANGE,.fk.range={0,1,0}}},.args=XGROUP_SETID_Args},
{"setid","Set a consumer group to an arbitrary last delivered ID value.","O(1)","5.0.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_STREAM,XGROUP_SETID_History,XGROUP_SETID_tips,xgroupCommand,-5,CMD_WRITE,ACL_CATEGORY_STREAM,{{NULL,CMD_KEY_RW|CMD_KEY_UPDATE,KSPEC_BS_INDEX,.bs.index={2},KSPEC_FK_RANGE,.fk.range={0,1,0}}},.args=XGROUP_SETID_Args},
{0}
};

Expand Down Expand Up @@ -6131,7 +6139,10 @@ struct redisCommandArg XINFO_CONSUMERS_Args[] = {
/********** XINFO GROUPS ********************/

/* XINFO GROUPS history */
#define XINFO_GROUPS_History NULL
commandHistory XINFO_GROUPS_History[] = {
{"7.0.0","Added the `entries-read` and `lag` fields"},
{0}
};

/* XINFO GROUPS tips */
#define XINFO_GROUPS_tips NULL
Expand All @@ -6153,7 +6164,10 @@ struct redisCommandArg XINFO_GROUPS_Args[] = {
/********** XINFO STREAM ********************/

/* XINFO STREAM history */
#define XINFO_STREAM_History NULL
commandHistory XINFO_STREAM_History[] = {
{"7.0.0","Added the `max-deleted-entry-id`, `entries-added`, `recorded-first-entry-id`, `entries-read` and `lag` fields"},
{0}
};

/* XINFO STREAM tips */
#define XINFO_STREAM_tips NULL
Expand Down Expand Up @@ -6332,7 +6346,10 @@ struct redisCommandArg XREVRANGE_Args[] = {
/********** XSETID ********************/

/* XSETID history */
#define XSETID_History NULL
commandHistory XSETID_History[] = {
{"7.0.0","Added the `entries_added` and `max_deleted_entry_id` arguments."},
{0}
};

/* XSETID tips */
#define XSETID_tips NULL
Expand All @@ -6341,6 +6358,8 @@ struct redisCommandArg XREVRANGE_Args[] = {
struct redisCommandArg XSETID_Args[] = {
{"key",ARG_TYPE_KEY,0,NULL,NULL,NULL,CMD_ARG_NONE},
{"last-id",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_NONE},
{"entries_added",ARG_TYPE_INTEGER,-1,"ENTRIESADDED",NULL,NULL,CMD_ARG_OPTIONAL},
{"max_deleted_entry_id",ARG_TYPE_STRING,-1,"MAXDELETEDID",NULL,NULL,CMD_ARG_OPTIONAL},
{0}
};

Expand Down Expand Up @@ -6947,8 +6966,8 @@ struct redisCommand redisCommandTable[] = {
{"evalsha","Execute a Lua script server side","Depends on the script that is executed.","2.6.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_SCRIPTING,EVALSHA_History,EVALSHA_tips,evalShaCommand,-3,CMD_NOSCRIPT|CMD_SKIP_MONITOR|CMD_MAY_REPLICATE|CMD_NO_MANDATORY_KEYS|CMD_STALE,ACL_CATEGORY_SCRIPTING,{{NULL,CMD_KEY_RW|CMD_KEY_ACCESS|CMD_KEY_UPDATE,KSPEC_BS_INDEX,.bs.index={2},KSPEC_FK_KEYNUM,.fk.keynum={0,1,1}}},evalGetKeys,.args=EVALSHA_Args},
{"evalsha_ro","Execute a read-only Lua script server side","Depends on the script that is executed.","7.0.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_SCRIPTING,EVALSHA_RO_History,EVALSHA_RO_tips,evalShaRoCommand,-3,CMD_NOSCRIPT|CMD_SKIP_MONITOR|CMD_NO_MANDATORY_KEYS|CMD_STALE,ACL_CATEGORY_SCRIPTING,{{NULL,CMD_KEY_RO|CMD_KEY_ACCESS,KSPEC_BS_INDEX,.bs.index={2},KSPEC_FK_KEYNUM,.fk.keynum={0,1,1}}},evalGetKeys,.args=EVALSHA_RO_Args},
{"eval_ro","Execute a read-only Lua script server side","Depends on the script that is executed.","7.0.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_SCRIPTING,EVAL_RO_History,EVAL_RO_tips,evalRoCommand,-3,CMD_NOSCRIPT|CMD_SKIP_MONITOR|CMD_NO_MANDATORY_KEYS|CMD_STALE,ACL_CATEGORY_SCRIPTING,{{"We cannot tell how the keys will be used so we assume the worst, RO and ACCESS",CMD_KEY_RO|CMD_KEY_ACCESS,KSPEC_BS_INDEX,.bs.index={2},KSPEC_FK_KEYNUM,.fk.keynum={0,1,1}}},evalGetKeys,.args=EVAL_RO_Args},
{"fcall","PATCH__TBD__38__","PATCH__TBD__37__","7.0.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_SCRIPTING,FCALL_History,FCALL_tips,fcallCommand,-3,CMD_NOSCRIPT|CMD_SKIP_MONITOR|CMD_MAY_REPLICATE|CMD_NO_MANDATORY_KEYS|CMD_STALE,ACL_CATEGORY_SCRIPTING,{{"We cannot tell how the keys will be used so we assume the worst, RW and UPDATE",CMD_KEY_RW|CMD_KEY_ACCESS|CMD_KEY_UPDATE,KSPEC_BS_INDEX,.bs.index={2},KSPEC_FK_KEYNUM,.fk.keynum={0,1,1}}},functionGetKeys,.args=FCALL_Args},
{"fcall_ro","PATCH__TBD__7__","PATCH__TBD__6__","7.0.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_SCRIPTING,FCALL_RO_History,FCALL_RO_tips,fcallroCommand,-3,CMD_NOSCRIPT|CMD_SKIP_MONITOR|CMD_NO_MANDATORY_KEYS|CMD_STALE,ACL_CATEGORY_SCRIPTING,{{"We cannot tell how the keys will be used so we assume the worst, RO and ACCESS",CMD_KEY_RO|CMD_KEY_ACCESS,KSPEC_BS_INDEX,.bs.index={2},KSPEC_FK_KEYNUM,.fk.keynum={0,1,1}}},functionGetKeys,.args=FCALL_RO_Args},
{"fcall","Invoke a function","Depends on the function that is executed.","7.0.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_SCRIPTING,FCALL_History,FCALL_tips,fcallCommand,-3,CMD_NOSCRIPT|CMD_SKIP_MONITOR|CMD_MAY_REPLICATE|CMD_NO_MANDATORY_KEYS|CMD_STALE,ACL_CATEGORY_SCRIPTING,{{"We cannot tell how the keys will be used so we assume the worst, RW and UPDATE",CMD_KEY_RW|CMD_KEY_ACCESS|CMD_KEY_UPDATE,KSPEC_BS_INDEX,.bs.index={2},KSPEC_FK_KEYNUM,.fk.keynum={0,1,1}}},functionGetKeys,.args=FCALL_Args},
{"fcall_ro","Invoke a read-only function","Depends on the function that is executed.","7.0.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_SCRIPTING,FCALL_RO_History,FCALL_RO_tips,fcallroCommand,-3,CMD_NOSCRIPT|CMD_SKIP_MONITOR|CMD_NO_MANDATORY_KEYS|CMD_STALE,ACL_CATEGORY_SCRIPTING,{{"We cannot tell how the keys will be used so we assume the worst, RO and ACCESS",CMD_KEY_RO|CMD_KEY_ACCESS,KSPEC_BS_INDEX,.bs.index={2},KSPEC_FK_KEYNUM,.fk.keynum={0,1,1}}},functionGetKeys,.args=FCALL_RO_Args},
{"function","A container for function commands","Depends on subcommand.","7.0.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_SCRIPTING,FUNCTION_History,FUNCTION_tips,NULL,-2,0,0,.subcommands=FUNCTION_Subcommands},
{"script","A container for Lua scripts management commands","Depends on subcommand.","2.6.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_SCRIPTING,SCRIPT_History,SCRIPT_tips,NULL,-2,0,0,.subcommands=SCRIPT_Subcommands},
/* sentinel */
Expand Down Expand Up @@ -7051,7 +7070,7 @@ struct redisCommand redisCommandTable[] = {
{"xread","Return never seen elements in multiple streams, with IDs greater than the ones reported by the caller for each stream. Can block.","For each stream mentioned: O(N) with N being the number of elements being returned, it means that XREAD-ing with a fixed COUNT is O(1). Note that when the BLOCK option is used, XADD will pay O(M) time in order to serve the M clients blocked on the stream getting new data.","5.0.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_STREAM,XREAD_History,XREAD_tips,xreadCommand,-4,CMD_BLOCKING|CMD_READONLY|CMD_BLOCKING,ACL_CATEGORY_STREAM,{{NULL,CMD_KEY_RO|CMD_KEY_ACCESS,KSPEC_BS_KEYWORD,.bs.keyword={"STREAMS",1},KSPEC_FK_RANGE,.fk.range={-1,1,2}}},xreadGetKeys,.args=XREAD_Args},
{"xreadgroup","Return new entries from a stream using a consumer group, or access the history of the pending entries for a given consumer. Can block.","For each stream mentioned: O(M) with M being the number of elements returned. If M is constant (e.g. always asking for the first 10 elements with COUNT), you can consider it O(1). On the other side when XREADGROUP blocks, XADD will pay the O(N) time in order to serve the N clients blocked on the stream getting new data.","5.0.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_STREAM,XREADGROUP_History,XREADGROUP_tips,xreadCommand,-7,CMD_BLOCKING|CMD_WRITE,ACL_CATEGORY_STREAM,{{NULL,CMD_KEY_RO|CMD_KEY_ACCESS,KSPEC_BS_KEYWORD,.bs.keyword={"STREAMS",4},KSPEC_FK_RANGE,.fk.range={-1,1,2}}},xreadGetKeys,.args=XREADGROUP_Args},
{"xrevrange","Return a range of elements in a stream, with IDs matching the specified IDs interval, in reverse order (from greater to smaller IDs) compared to XRANGE","O(N) with N being the number of elements returned. If N is constant (e.g. always asking for the first 10 elements with COUNT), you can consider it O(1).","5.0.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_STREAM,XREVRANGE_History,XREVRANGE_tips,xrevrangeCommand,-4,CMD_READONLY,ACL_CATEGORY_STREAM,{{NULL,CMD_KEY_RO|CMD_KEY_ACCESS,KSPEC_BS_INDEX,.bs.index={1},KSPEC_FK_RANGE,.fk.range={0,1,0}}},.args=XREVRANGE_Args},
{"xsetid","An internal command for replicating stream values","O(1)","5.0.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_STREAM,XSETID_History,XSETID_tips,xsetidCommand,3,CMD_WRITE|CMD_DENYOOM|CMD_FAST,ACL_CATEGORY_STREAM,{{NULL,CMD_KEY_RW|CMD_KEY_UPDATE,KSPEC_BS_INDEX,.bs.index={1},KSPEC_FK_RANGE,.fk.range={0,1,0}}},.args=XSETID_Args},
{"xsetid","An internal command for replicating stream values","O(1)","5.0.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_STREAM,XSETID_History,XSETID_tips,xsetidCommand,-3,CMD_WRITE|CMD_DENYOOM|CMD_FAST,ACL_CATEGORY_STREAM,{{NULL,CMD_KEY_RW|CMD_KEY_UPDATE,KSPEC_BS_INDEX,.bs.index={1},KSPEC_FK_RANGE,.fk.range={0,1,0}}},.args=XSETID_Args},
{"xtrim","Trims the stream to (approximately if '~' is passed) a certain size","O(N), with N being the number of evicted entries. Constant times are very small however, since entries are organized in macro nodes containing multiple entries that can be released with a single deallocation.","5.0.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_STREAM,XTRIM_History,XTRIM_tips,xtrimCommand,-4,CMD_WRITE,ACL_CATEGORY_STREAM,{{NULL,CMD_KEY_RW|CMD_KEY_DELETE,KSPEC_BS_INDEX,.bs.index={1},KSPEC_FK_RANGE,.fk.range={0,1,0}}},.args=XTRIM_Args},
/* string */
{"append","Append a value to a key","O(1). The amortized time complexity is O(1) assuming the appended value is small and the already present value is of any size, since the dynamic string library used by Redis will double the free space available on every reallocation.","2.0.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_STRING,APPEND_History,APPEND_tips,appendCommand,3,CMD_WRITE|CMD_DENYOOM|CMD_FAST,ACL_CATEGORY_STRING,{{NULL,CMD_KEY_RW|CMD_KEY_INSERT,KSPEC_BS_INDEX,.bs.index={1},KSPEC_FK_RANGE,.fk.range={0,1,0}}},.args=APPEND_Args},
Expand Down
12 changes: 12 additions & 0 deletions src/commands/xgroup-create.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
"arity": -5,
"container": "XGROUP",
"function": "xgroupCommand",
"history": [
[
"7.0.0",
"Added the `entries_read` named argument."
]
],
"command_flags": [
"WRITE",
"DENYOOM"
Expand Down Expand Up @@ -64,6 +70,12 @@
"name": "mkstream",
"type": "pure-token",
"optional": true
},
{
"token": "ENTRIESREAD",
"name": "entries_read",
"type": "integer",
"optional": true
}
]
}
Expand Down
14 changes: 13 additions & 1 deletion src/commands/xgroup-setid.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@
"complexity": "O(1)",
"group": "stream",
"since": "5.0.0",
"arity": 5,
"arity": -5,
"container": "XGROUP",
"function": "xgroupCommand",
"history": [
[
"7.0.0",
"Added the optional `entries_read` argument."
]
],
"command_flags": [
"WRITE"
],
Expand Down Expand Up @@ -57,6 +63,12 @@
"token": "$"
}
]
},
{
"name": "entries_read",
"token": "ENTRIESREAD",
"type": "integer",
"optional": true
}
]
}
Expand Down
6 changes: 6 additions & 0 deletions src/commands/xinfo-groups.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
"since": "5.0.0",
"arity": 3,
"container": "XINFO",
"history": [
[
"7.0.0",
"Added the `entries-read` and `lag` fields"
]
],
"function": "xinfoCommand",
"command_flags": [
"READONLY"
Expand Down
6 changes: 6 additions & 0 deletions src/commands/xinfo-stream.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
"since": "5.0.0",
"arity": -3,
"container": "XINFO",
"history": [
[
"7.0.0",
"Added the `max-deleted-entry-id`, `entries-added`, `recorded-first-entry-id`, `entries-read` and `lag` fields"
]
],
"function": "xinfoCommand",
"command_flags": [
"READONLY"
Expand Down
20 changes: 19 additions & 1 deletion src/commands/xsetid.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@
"complexity": "O(1)",
"group": "stream",
"since": "5.0.0",
"arity": 3,
"arity": -3,
"function": "xsetidCommand",
"history": [
[
"7.0.0",
"Added the `entries_added` and `max_deleted_entry_id` arguments."
]
],
"command_flags": [
"WRITE",
"DENYOOM",
Expand Down Expand Up @@ -43,6 +49,18 @@
{
"name": "last-id",
"type": "string"
},
{
"name": "entries_added",
"token": "ENTRIESADDED",
"type": "integer",
"optional": true
},
{
"name": "max_deleted_entry_id",
"token": "MAXDELETEDID",
"type": "string",
"optional": true
}
]
}
Expand Down
Loading