New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix XTRIM or XADD with LIMIT may delete more entries than Count. #9048
Conversation
6c1af92
to
b100c78
Compare
so you're saying it's an "off by one" bug. i.e. checking the limit after deletion rather than before. right? but note that what we documented is:
so are you sure there's a bug? or maybe we just lost our way... |
Checking the limit is still before deletion. For example, |
ohh, never mind. i mixed the documentation of MAXLEN with the LIMIT feature (two different features) |
i've edited the top comment, let me know (or fix it), if wrong. |
The old code might still delete less records than count, if the records to delete is less than required. So whether should make it more accurate. |
…is#9048) The decision to stop trimming due to LIMIT in XADD and XTRIM was after the limit was reached. i.e. the code was deleting **at least** that count of records (from the LIMIT argument's perspective, not the MAXLEN), instead of **up to** that count of records. see redis#9046 (cherry picked from commit eaa7a7b)
The decision to stop trimming due to LIMIT in XADD and XTRIM was after the limit was reached. i.e. the code was deleting **at least** that count of records (from the LIMIT argument's perspective, not the MAXLEN), instead of **up to** that count of records. see #9046 (cherry picked from commit eaa7a7b)
…is#9048) The decision to stop trimming due to LIMIT in XADD and XTRIM was after the limit was reached. i.e. the code was deleting **at least** that count of records (from the LIMIT argument's perspective, not the MAXLEN), instead of **up to** that count of records. see redis#9046
The decision to stop trimming due to LIMIT in XADD and XTRIM was after the limit was reached.
i.e. the code was deleting at least that count of records (from the LIMIT argument's perspective, not the MAXLEN),
instead of up to that count of records.
see #9046