Skip to content

Fix DB hash tables not expanding during RDB load#14789

Merged
ShooterIT merged 2 commits intoredis:unstablefrom
ShooterIT:expand
Feb 14, 2026
Merged

Fix DB hash tables not expanding during RDB load#14789
ShooterIT merged 2 commits intoredis:unstablefrom
ShooterIT:expand

Conversation

@ShooterIT
Copy link
Member

@ShooterIT ShooterIT commented Feb 13, 2026

In standalone mode, we create dicts on demand. by default, there is no dicts, and RESIZEDB hint doesn't expand dict actually. so we should create dict first when expanding if the dict does not exist.

internal ticket: RED-182685


Note

Medium Risk
Touches core kvstore resizing behavior and RDB load path; while the change is small, it can affect memory allocation patterns and startup performance during loading.

Overview
Fixes a standalone-mode bug where the RDB RESIZEDB hint could be ignored because per-slot kvstore dictionaries were allocated on-demand and not created during kvstoreExpand, preventing actual hashtable expansion.

kvstoreExpand now skips indices first and then calls createDictIfNeeded() before expanding, rdb.c logs a verbose message after applying the resize hint (including resulting bucket counts), and tests/integration/rdb.tcl adds an integration test that saves/restores an RDB and asserts the resize log message appears.

Written by Cursor Bugbot for commit fa037a5. This will update automatically on new commits. Configure here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

@augmentcode
Copy link

augmentcode bot commented Feb 13, 2026

🤖 Augment PR Summary

Summary: Fixes a case where the RDB RESIZEDB hint did not actually pre-expand DB hash tables when kvstores allocate dicts lazily, leading to rehashing during load.
Changes: Ensure kvstoreExpand() creates the dict before expanding; add a verbose log line for applied resize and an integration test validating the expected bucket growth on restart.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 1 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

@ShooterIT ShooterIT requested a review from tezc February 13, 2026 09:02
@ShooterIT ShooterIT merged commit 099203c into redis:unstable Feb 14, 2026
18 checks passed
@ShooterIT ShooterIT deleted the expand branch February 14, 2026 07:18
@github-project-automation github-project-automation bot moved this from Todo to Done in Redis 8.8 Feb 14, 2026
YaacovHazan pushed a commit that referenced this pull request Feb 23, 2026
In standalone mode, we create dicts on demand. by default, there is no
dicts, and RESIZEDB hint doesn't expand dict actually. so we should
create dict first when expanding if the dict does not exist.
kairosci pushed a commit to kairosci/redis that referenced this pull request Mar 5, 2026
In standalone mode, we create dicts on demand. by default, there is no
dicts, and RESIZEDB hint doesn't expand dict actually. so we should
create dict first when expanding if the dict does not exist.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants