redict/tests/unit/type
guybe7 814aad65f1
XADD and XTRIM, Trim by MINID, and new LIMIT argument (#8169)
This PR adds another trimming strategy to XADD and XTRIM named MINID
(complements the existing MAXLEN).
It also adds a new LIMIT argument that allows incremental trimming by repeated
calls (rather than all at once).

This provides the ability to trim all records older than a certain ID (which makes it
possible for the user to trim by age too).
Example:
XTRIM mystream MINID ~ 1608540753 will trim entries with id < 1608540753,
but might not trim all (because of the ~ modifier)

The purpose is to ease the use of streams. many users use streams as logs and
the common case is wanting a log
of the last X seconds rather than a log that contains maximum X entries (new
MINID vs existing MAXLEN)

The new LIMIT modifier is only supported when the trim strategy uses ~.
i.e. when the user asked for exact trimming, it all happens in one go (no
possibility for incremental trimming).
However, when ~ is provided, we trim full rax nodes, up to the limit number
of records.
The default limit is 100*stream_node_max_entries (used when LIMIT is not
provided).
I.e. this is a behavior change (even if the existing MAXLEN strategy is used).
An explicit limit of 0 means unlimited (but note that it's not the default).

Other changes:

Refactor arg parsing code for XADD and XTRIM to use common code.
2021-01-08 18:13:25 +02:00
..
hash.tcl Sanitize dump payload: improve tests of ziplist and stream encodings 2020-12-06 14:54:34 +02:00
incr.tcl skip a test that uses +inf on valgrind (#7440) 2020-07-10 08:29:02 +03:00
list-2.tcl Minor improvements for list-2 test (#8156) 2020-12-08 16:26:38 +02:00
list-3.tcl Test: new randomized stress tester for #3343 alike bugs. 2016-06-28 09:42:20 +02:00
list-common.tcl list test split into smaller parts 2011-07-11 11:30:46 +02:00
list.tcl Adds count to L/RPOP (#8179) 2020-12-25 21:49:24 +02:00
set.tcl Implement SMISMEMBER key member [member ...] (#7615) 2020-08-11 11:55:06 +03:00
stream-cgroups.tcl Add XAUTOCLAIM (#7973) 2021-01-06 10:34:27 +02:00
stream.tcl XADD and XTRIM, Trim by MINID, and new LIMIT argument (#8169) 2021-01-08 18:13:25 +02:00
string.tcl Getset fix (#8118) 2020-12-01 11:46:45 -08:00
zset.tcl Add ZRANGESTORE command, and improve ZSTORE command (#7844) 2021-01-07 10:58:53 +02:00