Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

SearchIndex.drop_keys does not validate cluster hash-tag co-location (inconsistent with drop_documents)

未关闭 适合新手
#601 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 5 天内回复

还没有人认领这个 Issue。

  • #614 来自 @algojogacor —— 已关闭,未合并

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
冷清
技术栈
python, redis
领域
databases

调研方向

从 redisvl/index/index.py 中的 SearchIndex.drop_keys(约第 826 行)开始,将其与 drop_documents(约第 840 行)进行比较,包括现有的 RedisCluster 哈希标签验证。确保两个方法具有完全一致的集群行为:无效的跨槽 key 必须在调用 delete 之前引发所述的 ValueError。

由索引模型根据 Issue 内容生成。

描述

bug good first issue index

Current behavior

SearchIndex.drop_documents (redisvl/index/index.py:840) explicitly validates that all keys share a hash tag before calling delete:

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.")
return self._redis_client.delete(*keys)

SearchIndex.drop_keys (redisvl/index/index.py:826) does not. On a clustered Redis Enterprise database, a multi-key DEL whose keys do not all hash to the same slot raises CROSSSLOT from the server — but only some redis-py client modes surface this cleanly. In others the call partially succeeds or fails opaquely.

Proposed change

Apply the same hash-tag check in drop_keys that drop_documents already applies, or factor the check into a shared helper called by both. Behavior on cluster should be identical between the two methods.

Why this surfaces

SemanticCache.drop() uses drop_keys under the hood for the keys= argument path and uses drop_documents for the ids= argument path. The two argument paths therefore behave differently on cluster, which is a footgun for customers building invalidation jobs that take whichever shape comes from their query results.

Notes

Surfaced while writing a scoped semantic caching architecture spec.

主要语言
Python
星标
431
派生
107
平均合并
5 天 17 小时
30 天内合并 PR
16

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

redis/redis-vl-python 的其他 Issue

查看 redis/redis-vl-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。