Skip to content

Code Review Bench PR #14646 - Replace fragile dict stored-key API with getKeyId callback#1

Open
tomerqodo wants to merge 2 commits intobase_pr_14646_20260125_7845from
corrupted_pr_14646_20260125_7845
Open

Code Review Bench PR #14646 - Replace fragile dict stored-key API with getKeyId callback#1
tomerqodo wants to merge 2 commits intobase_pr_14646_20260125_7845from
corrupted_pr_14646_20260125_7845

Conversation

@tomerqodo
Copy link

Code Review Bench PR redis#14646

Original PR Title: Replace fragile dict stored-key API with getKeyId callback
Original PR Description: ## Summary

  • Simplifies the dictionary API for handling stored keys by replacing the complex stored-key mechanism with a cleaner getKeyId callback approach.
  • As part of this effort, following Hash - Unify Field-Value into a single struct along with dict no_value=1 redis/redis#14595, hash field-value pairs were unified into a single Entry structure
    with the sds field at the start. Since both stored keys (Entry*) and lookup keys
    (sds) can now be trivially compared as sds strings, first two commits starts with cleanups of dictUseStoredKeyApi() for hash data type.

dict API Changes

  • Removed: storedHashFunction, storedKeyCompare callbacks and dictUseStoredKeyApi() flag
  • Added: Single dictType.keyFromStoredKey callback that extracts the key identifier from stored objects
  • Simplified: All dict operations now automatically extract keyId when needed, eliminating manual flag toggling
  • Clarified API: Dict function declarations now marks where they expects stored-key and when lookup key.

No performance impact.

Original PR URL: redis#14646

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.

1 participant