mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 00:28:26 -05:00
Fix migrateCommand may migrate wrong value. (#8815)
This scene is hard to happen. When first attempt some keys expired, only kv position is updated not ov. Then socket err happens, second attempt is taken. This time kv items may be mismatching with ov items.
This commit is contained in:
parent
c73b4ddfd9
commit
080d4579db
@ -5465,9 +5465,10 @@ try_again:
|
|||||||
if (ttl < 1) ttl = 1;
|
if (ttl < 1) ttl = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Relocate valid (non expired) keys into the array in successive
|
/* Relocate valid (non expired) keys and values into the array in successive
|
||||||
* positions to remove holes created by the keys that were present
|
* positions to remove holes created by the keys that were present
|
||||||
* in the first lookup but are now expired after the second lookup. */
|
* in the first lookup but are now expired after the second lookup. */
|
||||||
|
ov[non_expired] = ov[j];
|
||||||
kv[non_expired++] = kv[j];
|
kv[non_expired++] = kv[j];
|
||||||
|
|
||||||
serverAssertWithInfo(c,NULL,
|
serverAssertWithInfo(c,NULL,
|
||||||
|
Loading…
Reference in New Issue
Block a user