• Binbin's avatar
    Fix zuiFind crash / RM_ScanKey hang on SET object listpack encoding (#11581) · 20854cb6
    Binbin authored
    
    
    In #11290, we added listpack encoding for SET object.
    But forgot to support it in zuiFind, causes ZINTER, ZINTERSTORE,
    ZINTERCARD, ZIDFF, ZDIFFSTORE to crash.
    And forgot to support it in RM_ScanKey, causes it hang.
    
    This PR add support SET listpack in zuiFind, and in RM_ScanKey.
    And add tests for related commands to cover this case.
    
    Other changes:
    - There is no reason for zuiFind to go into the internals of the SET.
      It can simply use setTypeIsMember and don't care about encoding.
    - Remove the `#include "intset.h"` from server.h reduce the chance of
      accidental intset API use.
    - Move setTypeAddAux, setTypeRemoveAux and setTypeIsMemberAux
      interfaces to the header.
    - In scanGenericCommand, use setTypeInitIterator and setTypeNext
      to handle OBJ_SET scan.
    - In RM_ScanKey, improve hash scan mode, use lpGetValue like zset,
      they can share code and better performance.
    
    The zuiFind part fixes #11578
    Co-authored-by: default avatarOran Agra <oran@redislabs.com>
    Co-authored-by: default avatarViktor Söderqvist <viktor.soderqvist@est.tech>
    20854cb6
t_zset.c 146 KB