redict/tests
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
..
assets Sanitize dump payload: ziplist, listpack, zipmap, intset, stream 2020-12-06 14:54:34 +02:00
cluster Fix leak in new errorstats commit, and a flaky test (#8278) 2021-01-02 08:37:19 +02:00
helpers revert an accidental test code change done as part of the tls project 2019-12-01 16:10:09 +02:00
integration Report child copy-on-write info continuously 2021-01-07 16:14:29 +02:00
modules Remove read-only flag from non-keyspace cmds, different approach for EXEC to propagate MULTI (#8216) 2020-12-22 12:03:49 +02:00
sentinel Recalculate hardcoded variables from $::instances_count in sentinel tests (#7561) 2020-09-13 18:39:59 +03:00
support Report child copy-on-write info continuously 2021-01-07 16:14:29 +02:00
tmp minor fixes to the new test suite, html doc updated 2010-05-14 18:48:33 +02:00
unit XADD and XTRIM, Trim by MINID, and new LIMIT argument (#8169) 2021-01-08 18:13:25 +02:00
instances.tcl TLS: Add different client cert support. (#8076) 2020-12-11 18:31:40 +02:00
test_helper.tcl Add errorstats info section, Add failed_calls and rejected_calls to commandstats (#8217) 2020-12-31 16:53:43 +02:00