Skip to content

feat(commands): list/hash/set convenience variants (LPUSHX/RPUSHX/LMPOP/HRANDFIELD/SMOVE/SINTERCARD) #60

Description

@TinDang97

Summary

A grab-bag of missing convenience commands that client libraries call directly. None are load-bearing individually, but together they're a common source of "unknown command" errors during migration.

Missing commands

  • LPUSHX key element [element ...] — push only if key exists as list
  • RPUSHX key element [element ...] — push only if key exists as list
  • LMPOP numkeys key [key ...] LEFT|RIGHT [COUNT count] — multi-key non-blocking pop
  • HRANDFIELD key [count [WITHVALUES]] — random hash field sampling
  • SMOVE src dst member — atomic move between sets
  • SINTERCARD numkeys key [key ...] [LIMIT limit] — cardinality of intersection without materializing

Design notes

  • All are thin layers over existing operations. LPUSHX/RPUSHX are one-line guards on the existing push paths.
  • LMPOP needs the same multi-key iteration infrastructure that blocking ops will need — worth implementing before feat(commands): blocking list operations (BLPOP/BRPOP/BLMOVE/BLMPOP/BRPOPLPUSH) #56.
  • SMOVE must be atomic across two set operations on the same shard; cross-shard SMOVE requires the existing cross-shard dispatch plumbing.
  • HRANDFIELD sampling distribution must match Redis exactly for consistency tests.
  • SINTERCARD with LIMIT can short-circuit iteration — the whole point is avoiding the full materialization.

Acceptance criteria

  • Consistency tests for each command including the LIMIT/COUNT variants and the cross-shard SMOVE case.
  • No hot-path allocations.

References

  • Redis 6.2 / 7.0 changelog

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestredis-parityMissing Redis commands / parity gaps

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions