• huangzhw's avatar
    sort Command lookupKeyRead and lookupKeyWrite are used on the opposite (#8283) · 549fe1f3
    huangzhw authored
    This is a recent problem, introduced by 74717438 (redis 6.0)
    
    The implications are:
    The sole difference between LookupKeyRead and LookupKeyWrite is for command
    executed on a replica, which are not received from its master client. (for the master,
    and for the master client on the replica, these two functions behave the same)!
    
    Since SORT is a write command, this bug only implicates a writable-replica.
    And these are its implications:
    
    - SORT STORE will behave as it did before the above mentioned commit (like before
      redis 6.0). on a writable-replica an already logically expired the key would have
      appeared missing. (store dest key would be deleted, instead of being populated
      with the data from the already logically expired key)
    - SORT (the non store variant, which in theory could have been executed on
      read-only-replica if it weren't for the write flag), will (in redis 6.0) have a new bug
      and return the data from the already logically expired key instead of empty response.
    
    (cherry picked from commit 08ad6abd)
    549fe1f3
sort.c 22 KB