• binfeng-xin's avatar
    Call signalModifiedKey after the key modification is completed (#11144) · 56ec1ff1
    binfeng-xin authored
    
    
    Fix `signalModifiedKey()` order, call it after key modification
    completed, to ensure the state of key eventual consistency.
    
    When a key is modified, Redis calls `signalModifiedKey` to notify other
    systems, such as the watch system of transactions and the tracking
    system of client side caching. However, in some commands, the
    `signalModifiedKey` call happens during the key modification process
    instead of after the key modification is completed. This can potentially
    cause issues, as systems relying on `signalModifiedKey` may receive the
    "write in flight" status of the key rather than its final state.
    
    These commands include:
    1. PFADD
    2. LSET, LMOVE, LREM
    3. ZPOPMIN, ZPOPMAX, BZPOPMIN, BZPOPMAX, ZMPOP, BZMPOP
    
    Currently there is no problem with Redis, but it is better to adjust the
    order of `signalModifiedKey()`, to avoid issues in future development on
    Redis.
    
    ---------
    Co-authored-by: default avatarzhaozhao.zz <zhaozhao.zz@alibaba-inc.com>
    56ec1ff1
t_zset.c 152 KB