We propagate MAXLEN/MINID ~ as MAXLEN/MINID = * otherwise trimming is no longer deterministic on replicas / AOF. */
| 1770 | /* We propagate MAXLEN/MINID ~ <count> as MAXLEN/MINID = <resulting-len-of-stream> |
| 1771 | * otherwise trimming is no longer deterministic on replicas / AOF. */ |
| 1772 | void streamRewriteTrimArgument(client *c, stream *s, int trim_strategy, int idx) { |
| 1773 | robj *arg; |
| 1774 | if (trim_strategy == TRIM_STRATEGY_MAXLEN) { |
| 1775 | arg = createStringObjectFromLongLong(s->length); |
| 1776 | } else { |
| 1777 | streamID first_id; |
| 1778 | streamGetEdgeID(s, 1, &first_id); |
| 1779 | arg = createObjectFromStreamID(&first_id); |
| 1780 | } |
| 1781 | |
| 1782 | rewriteClientCommandArgument(c,idx,arg); |
| 1783 | decrRefCount(arg); |
| 1784 | } |
| 1785 | |
| 1786 | /* XADD key [(MAXLEN [~|=] <count> | MINID [~|=] <id>) [LIMIT <entries>]] [NOMKSTREAM] <ID or *> [field value] [field value] ... */ |
| 1787 | void xaddCommand(client *c) { |
no test coverage detected