Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions redisvl/index/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,13 @@ def drop_keys(self, keys: str | list[str]) -> int:
int: Count of records deleted from Redis.
"""
if isinstance(keys, list):
# Check for cluster compatibility
if isinstance(
self._redis_client, RedisCluster
) and not _keys_share_hash_tag(keys):
raise ValueError(
"All keys must share a hash tag when using Redis Cluster."
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Async drop_keys skips hash-tag check

Medium Severity

The new cluster hash-tag guard is only applied on sync drop_keys. AsyncSearchIndex.drop_keys still issues a multi-key delete without that check, so cluster callers of SemanticCache.adrop() can still hit CROSSSLOT while the matching sync path raises ValueError.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 79a77cf. Configure here.

return self._redis_client.delete(*keys) # type: ignore
else:
return self._redis_client.delete(keys) # type: ignore
Expand Down