mirror of
https://github.com/redis/redis.git
synced 2026-02-20 00:11:14 -05:00
fixed: issues from review
This commit is contained in:
parent
37a9f864b8
commit
5776d13dcc
2 changed files with 13 additions and 16 deletions
21
src/aof.c
21
src/aof.c
|
|
@ -2369,26 +2369,23 @@ int rewriteStreamObject(rio *r, robj *key, robj *o) {
|
|||
}
|
||||
raxStop(&ri_cons);
|
||||
|
||||
/* Emit XNACK FORCE for NACKed (unowned) entries in the group
|
||||
* PEL. These entries have consumer == NULL and are not
|
||||
* referenced from any consumer's PEL. */
|
||||
raxIterator ri_gpel;
|
||||
raxStart(&ri_gpel, group->pel);
|
||||
raxSeek(&ri_gpel, "^", NULL, 0);
|
||||
while (raxNext(&ri_gpel)) {
|
||||
streamNACK *nack = ri_gpel.data;
|
||||
if (nack->consumer != NULL) continue;
|
||||
/* Emit XNACK FORCE for NACKed (unowned) entries from the
|
||||
* NACK zone of the PEL time-ordered list
|
||||
* (pel_time_head..pel_nack_tail). */
|
||||
streamNACK *nack_end = group->pel_nack_tail;
|
||||
streamNACK *nack = group->pel_time_head;
|
||||
for (; nack && nack->pel_prev != nack_end; nack = nack->pel_next) {
|
||||
unsigned char buf[sizeof(streamID)];
|
||||
streamEncodeID(buf, &nack->id);
|
||||
if (rioWriteStreamNackedEntry(r, key, (char*)ri.key,
|
||||
ri.key_len, ri_gpel.key,
|
||||
ri.key_len, buf,
|
||||
nack) == 0)
|
||||
{
|
||||
raxStop(&ri_gpel);
|
||||
raxStop(&ri);
|
||||
streamIteratorStop(&si);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
raxStop(&ri_gpel);
|
||||
}
|
||||
raxStop(&ri);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3386,8 +3386,8 @@ start_server {
|
|||
set pending [r XPENDING mystream grp - + 10]
|
||||
assert_equal [llength $pending] 1
|
||||
assert_equal [lindex $pending 0 1] {}
|
||||
# UINT64_MAX wraps to -1 as signed long long in RESP
|
||||
assert_equal [lindex $pending 0 3] -1
|
||||
# UINT32_MAX delivered as integer in RESP
|
||||
assert_equal [lindex $pending 0 3] 4294967295
|
||||
}
|
||||
|
||||
test {XNACK releases entries regardless of owning consumer} {
|
||||
|
|
@ -3660,8 +3660,8 @@ start_server {
|
|||
|
||||
set pending [r XPENDING mystream grp - + 10]
|
||||
assert_equal [lindex $pending 0 1] {}
|
||||
# UINT64_MAX wraps to -1 as signed long long in RESP
|
||||
assert_equal [lindex $pending 0 3] -1
|
||||
# UINT32_MAX delivered as integer in RESP
|
||||
assert_equal [lindex $pending 0 3] 4294967295
|
||||
} {} {external:skip needs:debug}
|
||||
|
||||
start_server {tags {"stream needs:debug"} overrides {appendonly yes aof-use-rdb-preamble no appendfsync always}} {
|
||||
|
|
|
|||
Loading…
Reference in a new issue