Fix: Add support for listpack encoding in Redis 7.0+ #68
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The scanner crashes when encountering keys with
listpackencoding:This occurs when scanning Redis 7.0+ instances, as the tool doesn't recognize the newer
listpackencoding type.Solution
Added support for the
listpackencoding type inredis_types.py:- Added
REDIS_ENCODING_ID_LISTPACK = 9constant- Added
b'listpack': REDIS_ENCODING_ID_LISTPACKmapping toREDIS_ENCODING_STR_TO_ID_LIB- Included it in
REDIS_ENCODING_ID_ALLlistBackground
listpackis a more memory-efficient encoding introduced in Redis 7.0 as a replacement forziplistin certain data structures (hashes, sorted sets, and streams).Testing
Tested against Redis 7.0+ instance with keys using listpack encoding. The scanner now completes successfully without errors.