Add client support for replication scale plans (GET/POST /v1/replication/scale)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Read the existing client.cluster.replications methods (get, query and cancel), related models in weaviate.cluster.models, and the client’s version checks and stub generation workflow. Implement sync and async methods for retrieving and applying scale plans, with typed models, validation, and server version handling. Add unit, mock, and integration coverage; done means the scale plan can be retrieved and applied against a supported server, with the requested error and validation cases covered.
由索引模型根据 Issue 内容生成。
描述
Summary
Weaviate has offered GET and POST /v1/replication/scale since v1.35. They compute and apply a plan to change a collection's replication factor. The Python client has no methods for them, so changing a collection's replication factor from Python means making raw REST calls and building the plan payload by hand.
Proposal
Add two methods to the existing client.cluster.replications namespace, next to get, query and cancel, for both the sync and async clients:
plan = client.cluster.replications.get_scale_plan(collection="Article", replication_factor=3)
# inspect plan.shard_scale_actions -> {shard: ShardScaleActions(remove_nodes=[...], add_nodes={target: source | None})}
result = client.cluster.replications.apply_scale_plan(plan=plan)
# result.operation_ids -> the started shard copy operations, trackable with replications.get(uuid=...)
- New typed models in
weaviate.cluster.models:ReplicationScalePlan,ShardScaleActionsandReplicationScaleApplyResult. They are exported fromweaviate.outputs.replication. - A version check raises
WeaviateUnsupportedFeatureErroron servers older than 1.35, the same way tokenization and export do. replication_factoris validated on the client (it must be an integer of at least 1), and the collection name's first letter is capitalised, as elsewhere in the client.- Additive only: no changes to existing signatures, overloads or dependencies. The stubs are regenerated with
tools/stubs_regen.sh.
Validation done locally
I have a working implementation, tested against a local 3-node 1.40.5 cluster with REPLICA_MOVEMENT_ENABLED=true:
- Scaling a 2-shard collection from 1 to 3 replicas started 4 copy operations, all of which reached
READY, and all objects stayed readable. - Scaling back down produced a removal-only plan, applied with no copy operations.
- Added unit and mock tests (sync and async, plan round-trip, invalid factor, old-server error) and an integration test in
integration/test_replicate.py. ruff,pyright1.1.399 and the flake8 pre-commit hooks pass.
Would you accept a PR for this? I'm happy to adjust the method names or where they live, for example on client.cluster next to replicate() instead.
- 主要语言
- Python
- 星标
- 230
- 派生
- 173
- 平均合并
- 4 天 16 小时
- 30 天内合并 PR
- 23
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
weaviate/weaviate-python-client 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 84/100
weaviate/weaviate-python-client#2265 ·
维护者通常 1 天内回复
-
Batch: re-added rate-limited objects stay in results.objs.all_responses as errors可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
weaviate/weaviate-python-client#2179 ·
维护者通常 1 天内回复
-
collections/batch: one object that fails client-side encoding fails every object sent with it可能已有人在做 @shadowmodder 今天认领。 未关闭bug
难度 3/5 1-2 天 新手友好度 72/100
weaviate/weaviate-python-client#2266 ·
维护者通常 1 天内回复
-
batch insert fails the whole batch with "ValueError: Unexpected type" when a value is a Decimal可能已有人在做 @steven-asearcy 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 35/100
weaviate/weaviate-python-client#2263 ·
维护者通常 1 天内回复
-
collections/batch/sync.py: after a fast hang-up reconnect the old stream's sender steals a request, hanging add_object可能已有人在做 @shadowmodder 于 2 天前认领。 未关闭bug
难度 4/5 3-5 天 新手友好度 45/100
weaviate/weaviate-python-client#2261 ·
维护者通常 1 天内回复
查看 weaviate/weaviate-python-client 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 67/100
-
breaking change
难度 1/5 1 小时以内 新手友好度 84/100
it-at-m/lhm_actions#441 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
TigreGotico/euskaphone#68 ·
维护者通常 1 天内回复
-
[BUG] arc_agi_2: a correct grid in the format the prompt asks for scores 0 (exact_match gold is a one-line list)可能已有人在做 @BahaaMattar 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
huggingface/lighteval#1510 ·
维护者通常 1 天内回复