Skip to content

feat(sentinel): add scan iterator#3278

Open
raashish1601 wants to merge 1 commit into
redis:masterfrom
raashish1601:codex/2999-sentinel-scan-iterator
Open

feat(sentinel): add scan iterator#3278
raashish1601 wants to merge 1 commit into
redis:masterfrom
raashish1601:codex/2999-sentinel-scan-iterator

Conversation

@raashish1601
Copy link
Copy Markdown
Contributor

@raashish1601 raashish1601 commented May 17, 2026

Summary

  • add scanIterator() to RedisSentinel
  • add scanIterator() to acquired RedisSentinelClient leases
  • release the Sentinel facade's master lease before yielding each SCAN page to avoid starving a one-client master pool
  • add Sentinel scan iterator coverage, including a no-deadlock regression

Closes #2999

Validation

  • npm run lint:changed
  • npm run build

Sentinel integration tests were not run locally because Docker is not installed in this environment.


Note

Medium Risk
Adds a new async-iterator API around SCAN on Sentinel and leased clients, touching pooled lease usage and iteration control flow; risk is mainly around potential pool starvation/performance/regression in edge cursor/type cases.

Overview
Adds scanIterator() to both the RedisSentinel facade and acquired RedisSentinelClient leases, providing an async generator that pages through SCAN results (with optional starting cursor) and yields key batches until completion.

Includes new Sentinel integration tests covering password/no-password setups, iteration via both the facade and leased clients, and a regression case ensuring iteration doesn’t deadlock when the master pool is size 1 (by releasing the per-page lease before yielding).

Reviewed by Cursor Bugbot for commit a4c51cb. Bugbot is set up for automated code reviews on this repo. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

scanIterator on RedisSentinel

1 participant