Add client support for replication scale plans (GET/POST /v1/replication/scale)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
調査の方向性
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時間
- マージ済み PR(30日)
- 23
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 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 日以内に返信