Skip to content

Fix rdbLoadObject() empty hash#13347

Merged
moticless merged 7 commits intoredis:unstablefrom
moticless:fix-rdb-load-empty-hash
Jun 20, 2024
Merged

Fix rdbLoadObject() empty hash#13347
moticless merged 7 commits intoredis:unstablefrom
moticless:fix-rdb-load-empty-hash

Conversation

@moticless
Copy link
Collaborator

@moticless moticless commented Jun 16, 2024

As part of HFE feature, the logic of rdbLoadObject() was wrongly modified to indicate of loaded empty hash from RDB as hash that all its fields got expired. Rollback to emptykey logic. This function should load blindly all fields, expired or not.

Manually verified:

605548:M 16 Jun 2024 09:20:54.278 * Server initialized
605548:M 16 Jun 2024 09:20:54.278 * Loading RDB produced by version 255.255.255
605548:M 16 Jun 2024 09:20:54.278 * RDB age 484889 seconds
605548:M 16 Jun 2024 09:20:54.278 * RDB memory usage when created 1.11 Mb
605548:M 16 Jun 2024 09:20:54.278 * rdbLoadObject skipping empty key: myhash0123456789

Few more minor fixes:

  • remove hash double check of emptyKey
  • Fix from sds to hfield in rdbLoadObject() (not really a bug. Both are of type char*)
  • Revert code rdbLoadObject() to get dbid instead of db

@moticless moticless force-pushed the fix-rdb-load-empty-hash branch from 5547002 to 2e7a4e9 Compare June 20, 2024 09:08
@ronen-kalish
Copy link
Collaborator

LGTM

@ronen-kalish ronen-kalish self-requested a review June 20, 2024 10:51
@moticless moticless merged commit e18a173 into redis:unstable Jun 20, 2024
@moticless moticless deleted the fix-rdb-load-empty-hash branch June 20, 2024 10:53
funny-dog pushed a commit to funny-dog/redis that referenced this pull request Sep 17, 2025
As part of HFE feature, the logic of rdbLoadObject() was wrongly
modified to indicate of loaded empty hash from RDB as hash that all its
fields got expired. Rollback to `emptykey` logic. This function should
load blindly all fields, expired or not. Manually verified.

Few more minor fixes:
- remove hash double check of emptyKey
- Fix from `sds` to `hfield` in rdbLoadObject() (not really a bug. Both
are of type char*)
- Revert code rdbLoadObject() to get dbid instead of db
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.

2 participants