mirror of
https://github.com/fluencelabs/redis
synced 2025-06-12 16:51:22 +00:00
Make SORT BY <constant> STORE ... to always produce the same output by force sorting, so that we have deterministic replication of this command.
This commit is contained in:
@ -203,6 +203,15 @@ void sortCommand(redisClient *c) {
|
||||
j++;
|
||||
}
|
||||
|
||||
/* If we have STORE we need to force sorting for deterministic output
|
||||
* and replication. We use alpha sorting since this is guaranteed to
|
||||
* work with any input. */
|
||||
if (storekey && dontsort) {
|
||||
dontsort = 0;
|
||||
alpha = 1;
|
||||
sortby = NULL;
|
||||
}
|
||||
|
||||
/* Destructively convert encoded sorted sets for SORT. */
|
||||
if (sortval->type == REDIS_ZSET)
|
||||
zsetConvert(sortval, REDIS_ENCODING_SKIPLIST);
|
||||
|
Reference in New Issue
Block a user