Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make hscan return flat list of entries #1300

Merged
merged 7 commits into from
Aug 13, 2023
Merged

Conversation

silverwind
Copy link
Contributor

@silverwind silverwind commented Aug 7, 2023

Fixes: #962
Ref: https://redis.io/commands/scan/#return-value

HSCAN [returns an] array of elements contain two elements, a field and a value, for every returned element of the Hash.

@silverwind silverwind changed the title Fix hscan returning keys instead of pairs Fix hscan returning keys instead of pairs Aug 7, 2023
src/commands/hscan.js Outdated Show resolved Hide resolved
@silverwind silverwind changed the title Fix hscan returning keys instead of pairs fix: makehscan return flat list of entries Aug 8, 2023
@silverwind silverwind changed the title fix: makehscan return flat list of entries fix: make hscan return flat list of entries Aug 8, 2023
Copy link
Owner

@stipsan stipsan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@stipsan stipsan merged commit 6f440f0 into stipsan:main Aug 13, 2023
13 checks passed
@github-actions
Copy link
Contributor

🎉 This PR is included in version 8.8.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@silverwind silverwind deleted the hscan branch August 14, 2023 12:04
znewton added a commit to microsoft/FluidFramework that referenced this pull request Sep 10, 2024
## Description

During peak traffic hours, the RedisCollaborationSessionManager
introduced in #22381 could potentially return thousands of sessions.
After 1,600 sessions, this exceeds the recommended maximum Redis
response size of 200kb (each session+key is about 172 bytes) for optimal
efficiency.

To improve efficiency, we can use [Redis
HSCAN](https://redis.io/docs/latest/commands/hscan/) to fetch sessions
from Redis in batches. Here, the default number of sessions per batch is
800 (half the maximum) to allow wiggle room for future session
information.

### Tests

Added some unit tests for the RedisCollaborationSessionManager, and
bumped the `ioredis-mock` version to include stipsan/ioredis-mock#1300.
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.

hscan returns only fields
2 participants