Sanitize dump payload: handle remaining empty key when RDB loading and restore command#9349
Merged
oranagra merged 3 commits intoredis:unstablefrom Aug 9, 2021
Merged
Conversation
…d restore command
Collaborator
Author
|
@oranagra I'm not sure if intset needs to be handled in the same way, |
Member
|
@sundb i think we can leave intsets and even zipmaps out of this party (if they're empty we can fail) |
Member
|
or if you think it's nicer to handle an empty zipmap (just for code consistency), i'm fine with that too. |
oranagra
reviewed
Aug 9, 2021
abc0063 to
bade4f3
Compare
Collaborator
Author
|
@oranagra I think it is a better way to avoid adding code to rdb.c, it is huge enough. |
oranagra
approved these changes
Aug 9, 2021
JackieXie168
pushed a commit
to JackieXie168/redis
that referenced
this pull request
Sep 8, 2021
…d restore command (redis#9349) This commit mainly fixes empty keys due to RDB loading and restore command, which was omitted in redis#9297. 1) When loading quicklsit, if all the ziplists in the quicklist are empty, NULL will be returned. If only some of the ziplists are empty, then we will skip the empty ziplists silently. 2) When loading hash zipmap, if zipmap is empty, sanitization check will fail. 3) When loading hash ziplist, if ziplist is empty, NULL will be returned. 4) Add RDB loading test with sanitize.
Merged
oranagra
pushed a commit
that referenced
this pull request
Oct 4, 2021
…d restore command (#9349) This commit mainly fixes empty keys due to RDB loading and restore command, which was omitted in #9297. 1) When loading quicklsit, if all the ziplists in the quicklist are empty, NULL will be returned. If only some of the ziplists are empty, then we will skip the empty ziplists silently. 2) When loading hash zipmap, if zipmap is empty, sanitization check will fail. 3) When loading hash ziplist, if ziplist is empty, NULL will be returned. 4) Add RDB loading test with sanitize. (cherry picked from commit cbda492)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pr mainly fixes empty keys due to RDB loading and restore command, which was omitted in #9297.
If only some of the ziplists are empty, then we will skip the empty ziplists silently.