defrag.c activeDefragSdsListAndDict when defrag sdsele, We can't use (#7492)

it to calculate hash, we should use newsds.
This commit is contained in:
huangzhw 2020-07-10 13:29:44 +08:00 committed by GitHub
parent 909bc97c52
commit d6180c8c86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -348,7 +348,7 @@ long activeDefragSdsListAndDict(list *l, dict *d, int dict_val_type) {
sdsele = ln->value;
if ((newsds = activeDefragSds(sdsele))) {
/* When defragging an sds value, we need to update the dict key */
uint64_t hash = dictGetHash(d, sdsele);
uint64_t hash = dictGetHash(d, newsds);
replaceSateliteDictKeyPtrAndOrDefragDictEntry(d, sdsele, newsds, hash, &defragged);
ln->value = newsds;
defragged++;