Skip to content

Add --async_replication_config option to create/update collection#164

Open
jfrancoa wants to merge 7 commits intomainfrom
jose/async-replication-collection-params
Open

Add --async_replication_config option to create/update collection#164
jfrancoa wants to merge 7 commits intomainfrom
jose/async-replication-collection-params

Conversation

@jfrancoa
Copy link
Copy Markdown
Collaborator

@jfrancoa jfrancoa commented Mar 25, 2026

Summary

  • Add --async_replication_config key=value repeatable option to create collection and update collection commands
  • Exposes 14 async replication tuning parameters (max_workers, frequency, propagation_concurrency, etc.) from weaviate-python-client PR #1953
  • Uses a single repeatable option with key=value pairs instead of 14 individual flags to keep the CLI clean
  • Add parse_async_replication_config() helper in utils.py with key/value validation
  • Add unit tests for the parser and both create/update collection paths

Closes #163

Usage

# Create with async replication config
weaviate-cli create collection --collection MyCol --async_enabled \
  --async_replication_config max_workers=10 \
  --async_replication_config frequency=60 \
  --async_replication_config propagation_concurrency=4

# Update async replication config
weaviate-cli update collection --collection MyCol \
  --async_replication_config max_workers=20 \
  --async_replication_config propagation_batch_size=100

Test plan

  • make lint passes
  • make test passes (283/283)
  • Manual test with Weaviate >= v1.34.18

🤖 Generated with Claude Code

Copy link
Copy Markdown

@orca-security-eu orca-security-eu Bot left a comment

Choose a reason for hiding this comment

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

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_config into 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.

Comment thread weaviate_cli/managers/collection_manager.py
Comment thread weaviate_cli/commands/create.py Outdated
Comment thread weaviate_cli/commands/update.py Outdated
Comment thread weaviate_cli/managers/collection_manager.py
Comment thread weaviate_cli/managers/collection_manager.py
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread weaviate_cli/utils.py Outdated
Comment thread weaviate_cli/managers/collection_manager.py
Comment thread .claude/skills/operating-weaviate-cli/references/collections.md Outdated
Comment thread .claude/skills/operating-weaviate-cli/SKILL.md Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread setup.cfg Outdated
Comment thread requirements-dev.txt Outdated
Comment thread weaviate_cli/utils.py
@jfrancoa jfrancoa force-pushed the jose/async-replication-collection-params branch from 68f553a to 9ebab2b Compare March 27, 2026 13:28
jfrancoa and others added 6 commits May 5, 2026 16:30
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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread weaviate_cli/utils.py
Comment thread weaviate_cli/utils.py
Comment thread weaviate_cli/managers/collection_manager.py
Comment thread weaviate_cli/defaults.py Outdated
- 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>
@jfrancoa jfrancoa force-pushed the jose/async-replication-collection-params branch from 9ebab2b to 5985492 Compare May 5, 2026 15:56
@jfrancoa jfrancoa requested a review from Copilot May 5, 2026 15:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread weaviate_cli/utils.py
Comment on lines +139 to +145
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."
)
Comment on lines +277 to +279
raise click.UsageError(
"--async_replication_config 'reset' is only supported on update, not create."
)
Comment on lines +259 to +265
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."
)
Comment on lines +674 to +680
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."
)
Comment on lines +142 to +150
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add --async_replication_config option to create/update collection

2 participants