Add --async_replication_config option to create/update collection#164
Add --async_replication_config option to create/update collection#164
Conversation
There was a problem hiding this comment.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Infrastructure as Code | View in Orca | ||
| SAST | View in Orca | ||
| Secrets | View in Orca | ||
| Vulnerabilities | View in Orca |
There was a problem hiding this comment.
Pull request overview
Adds a new repeatable --async_replication_config key=value option to the CLI to expose async replication tuning parameters when creating/updating collections, including parsing/validation logic and unit tests to cover the new behavior.
Changes:
- Introduces
parse_async_replication_config()and a validated key allowlist for async replication tuning parameters. - Wires
async_configinto collection create/update replication config via the Python client configuration objects. - Adds unit tests for the parser and manager create/update paths; updates operating docs for the new option.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
weaviate_cli/utils.py |
Adds allowlisted keys and a parser to convert repeatable key=value tuples into a validated dict of ints. |
weaviate_cli/managers/collection_manager.py |
Passes parsed async replication config into wvc.Configure/Reconfigure.*.async_config(...) when present. |
weaviate_cli/defaults.py |
Adds defaults entries for the new CLI option. |
weaviate_cli/commands/create.py |
Adds Click option and passes parsed async replication config into CollectionManager.create_collection(...). |
weaviate_cli/commands/update.py |
Adds Click option and passes parsed async replication config into CollectionManager.update_collection(...). |
test/unittests/test_utils.py |
Adds unit tests for the async replication config parser (happy path + error cases). |
test/unittests/test_managers/test_collection_manager.py |
Adds tests asserting asyncConfig is set/omitted on create/update replication config. |
.claude/skills/operating-weaviate-cli/references/collections.md |
Documents the new option and provides examples for create/update. |
.claude/skills/operating-weaviate-cli/SKILL.md |
Updates the “operating” skill docs with the new option and examples. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
68f553a to
9ebab2b
Compare
Expose the 14 async replication tuning parameters from weaviate-python-client PR #1953 via a single repeatable --async_replication_config key=value option. This avoids bloating the CLI with 14 individual flags while letting users configure any subset of parameters. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Reject --async_replication_config when --async_enabled is not set (create) - Reject --async_replication_config when --async_enabled is False (update) - Warn when server version is older than v1.36.0 - Generate Click help text from ASYNC_REPLICATION_CONFIG_KEYS constant - Add validation tests for both create and update paths Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add --async_enabled prerequisite to help text, SKILL.md, and collections.md - Point weaviate-client dependency to jose/fix-async-repl-config-get branch - Update setup.cfg install_requires to match Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add --async_enabled prerequisite to help text, SKILL.md, and collections.md - Point weaviate-client dependency to jose/fix-async-repl-config-get branch - Update setup.cfg install_requires to match - Change minimum version to 1.34.18 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Support "reset" keyword to revert all async replication settings to server defaults. Use `is not None` checks so empty dict (reset) is correctly forwarded as an empty async_config() call. Update version references to v1.34.18. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Use ASYNC_REPLICATION_CONFIG_RESET constant in parser instead of literal - Remove unused async_replication_config field from CreateCollectionDefaults and UpdateCollectionDefaults - Reject --async_replication_config 'reset' on create (no semantics for new collections) - Tighten type annotations: tuple -> Tuple[str, ...] - Drop trivially-dead `if result else None` return - Add unit tests for old-version warning path (create + update) - Add unit test for update reset path asserting Reconfigure.Replication.async_config() is invoked with no kwargs Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
9ebab2b to
5985492
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ASYNC_REPLICATION_CONFIG_HELP = ( | ||
| "Async replication config as key=value pairs. Can be specified multiple times. " | ||
| "Valid keys: " + ", ".join(sorted(ASYNC_REPLICATION_CONFIG_KEYS)) + ". " | ||
| "All values must be integers. " | ||
| 'Use "reset" to revert all async replication settings to server defaults. ' | ||
| "Requires --async_enabled on create and Weaviate >= v1.34.18." | ||
| ) |
| raise click.UsageError( | ||
| "--async_replication_config 'reset' is only supported on update, not create." | ||
| ) |
| if async_replication_config is not None and older_than_version( | ||
| self.client, "1.34.18" | ||
| ): | ||
| click.echo( | ||
| "Warning: --async_replication_config requires Weaviate >= v1.34.18. " | ||
| "The server may ignore or reject these settings." | ||
| ) |
| if async_replication_config is not None and older_than_version( | ||
| self.client, "1.34.18" | ||
| ): | ||
| click.echo( | ||
| "Warning: --async_replication_config requires Weaviate >= v1.34.18. " | ||
| "The server may ignore or reject these settings." | ||
| ) |
| Key create options: `--multitenant`, `--auto_tenant_creation`, `--auto_tenant_activation`, `--shards N`, `--vectorizer <type>`, `--named_vector`, `--replication_deletion_strategy`, `--async_replication_config key=value` (repeatable; requires `--async_enabled` and Weaviate >= v1.34.18), `--object_ttl_type`, `--object_ttl_time`, `--object_ttl_filter_expired`, `--object_ttl_property_name` (only when `object_ttl_type=property`) | ||
|
|
||
| Mutable fields: `--async_enabled`, `--replication_factor`, `--vector_index`, `--description`, `--training_limit`, `--auto_tenant_creation`, `--auto_tenant_activation`, `--replication_deletion_strategy`, `--object_ttl_type`, `--object_ttl_time`, `--object_ttl_filter_expired`, `--object_ttl_property_name` (only when `object_ttl_type=property`) | ||
| Mutable fields: `--async_enabled`, `--replication_factor`, `--vector_index`, `--description`, `--training_limit`, `--auto_tenant_creation`, `--auto_tenant_activation`, `--replication_deletion_strategy`, `--async_replication_config key=value` (repeatable), `--object_ttl_type`, `--object_ttl_time`, `--object_ttl_filter_expired`, `--object_ttl_property_name` (only when `object_ttl_type=property`) | ||
|
|
||
| #### Async Replication Config | ||
|
|
||
| ```bash | ||
| # Create with async replication tuning (requires --async_enabled and Weaviate >= v1.34.18) | ||
| weaviate-cli create collection --collection MyCol --async_enabled \ |
| - `--hfresh_search_probe` -- (hfresh only) Search probe size (default: None, uses server default) | ||
| - `--distance_metric` -- Distance metric: cosine, dot, l2-squared, hamming, manhattan (default: None, uses server default). Applies to all vector index types. | ||
| - `--rescore_limit` -- Rescore limit for quantized indexes (default: None, uses server default) | ||
| - `--async_replication_config` -- Async replication tuning as `key=value` pairs (repeatable). Valid keys: `max_workers`, `hashtree_height`, `frequency`, `frequency_while_propagating`, `alive_nodes_checking_frequency`, `logging_frequency`, `diff_batch_size`, `diff_per_node_timeout`, `pre_propagation_timeout`, `propagation_timeout`, `propagation_limit`, `propagation_delay`, `propagation_concurrency`, `propagation_batch_size`. All values must be integers. Use `reset` to revert all to server defaults. Requires `--async_enabled` on create and Weaviate >= v1.34.18. |
Summary
--async_replication_config key=valuerepeatable option tocreate collectionandupdate collectioncommandsparse_async_replication_config()helper in utils.py with key/value validationCloses #163
Usage
Test plan
make lintpassesmake testpasses (283/283)🤖 Generated with Claude Code