fix(rdb_load): fix partial reads dropping elements #3853
Merged
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.
Found a bug in loading huge objects where we append to the wrong encoding.
Say you have a hmap with 4100 integers, we'll load 4092 then 8 elements. The first
CreateHMap
will see4092 > 64
so create aStringMap
, but the secondCreateHMap
will see8 < 64
so creates anlpNew
instead of appending to the existingStringMap
(meaning the existing elements are lost). Same applies to set (when loading an 'intset') and zset.Therefore adding an
item.streamed
to be really explicit about whether the item is being streamed so the larger encoding must always be used. We could probably infer fromappend
andreserve
but seemed better to be explicit.