Skip to content

Add JSON-based deep prefetching for hash and zset inner hashtables#17

Merged
roshkhatri merged 3 commits into
prefetch-inner-hashtablefrom
prefetch-inner-hashtable-v2
Jun 9, 2026
Merged

Add JSON-based deep prefetching for hash and zset inner hashtables#17
roshkhatri merged 3 commits into
prefetch-inner-hashtablefrom
prefetch-inner-hashtable-v2

Conversation

@roshkhatri

Copy link
Copy Markdown
Owner

No description provided.

Extends the memory prefetch system to walk inner hashtables for hash
(OBJ_ENCODING_HASHTABLE) and sorted set (OBJ_ENCODING_SKIPLIST) types.

Commands declare which argv position holds the field/member lookup key
via member_key_index in their JSON spec. Supports multi-field commands
via member_key_step (stride) and member_key_count (limit).

22 commands annotated: HGET, HEXISTS, HSTRLEN, HINCRBY, HINCRBYFLOAT,
HSETNX, HDEL, HMGET, HSET, HMSET, HGETDEL, HPERSIST, HEXPIRETIME,
HPEXPIRETIME, HTTL, HPTTL, ZSCORE, ZRANK, ZREVRANK, ZREM, ZMSCORE,
ZINCRBY.

Signed-off-by: Roshan Khatri <rvkhatri@amazon.com>
- Store per-key argv/argc in batch instead of relying on client->argv
  (fixes wrong field lookup for queued/pipelined commands)
- Clear key_clients entries in removeClientFromPendingCommandsBatch
  (prevents use-after-free on client disconnect)
- Remove unreachable dead code after exhaustive switch
- Add TCL integration test for deep prefetch with io-threads

Signed-off-by: Roshan Khatri <rvkhatri@amazon.com>
key_clients is no longer needed since we store per-key argv/argc directly.
The client param in addCommandToBatch was only used to populate key_clients.

Signed-off-by: Roshan Khatri <rvkhatri@amazon.com>
@roshkhatri roshkhatri merged commit ebe4125 into prefetch-inner-hashtable Jun 9, 2026
46 checks passed
@roshkhatri roshkhatri deleted the prefetch-inner-hashtable-v2 branch June 9, 2026 23:31
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