Add replication management functionality to ClusterClient #174
+2,278
−11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR adds full replication management capabilities to the cluster API surface of the C# client. Users can initiate replica COPY/MOVE operations for shards, monitor progress via a tracking abstraction, cancel in-flight operations, list/query operations with filters, and clean up (delete single/all) completed or cancelled operations.
Rebase Context
The branch
feat/cluster-apiwas rebased ontofeat/rbac-apisto incorporate the latest RBAC infrastructure and shared error-handling improvements. No RBAC functionality was modified here, but the rebase ensures consistent exception types, OpenAPI-driven REST patterns, and documentation structure.Summary of Changes
ClusterClient.Replicate()andReplicateSync()plus a new lazily-initializedReplicationsproperty (ReplicationsClient).ReplicationType,ReplicationOperationState,ReplicationOperationStatus,ReplicationOperationError,ReplicationOperation,ReplicateRequest,ReplicationClientConfig).ReplicationOperationTrackerwith background polling, manual refresh, synchronous wait (WaitForCompletion), and cancellation helpers (Cancel,CancelSync). ImplementsIDisposable/IAsyncDisposablefor resource cleanup.WeaviateRestClient(ReplicateAsync,ReplicationDetailsAsync,ListReplicationsAsync,CancelReplicationAsync,DeleteReplicationAsync,DeleteAllReplicationsAsync) plus URL builders inEndpoints.cs.ResourceTypewithReplicationand added new internalWeaviateNotFoundExceptionoverload supporting contextual data (operationId).docs/REPLICATION_API_USAGE.mdand implementation summarydocs/REPLICATION_IMPLEMENTATION_SUMMARY.md.TestReplication(covers start, get, list/filter, cancel, delete, bulk delete, tracker properties, external cancellation detection, successful completion). Uses dedicated ports to avoid conflicts with other suites.8087, 8088, 8089for replication operations.API Surface
Naming Decision (Post-Rebase Adjustment)
During rebase a temporary alias
NodesVerbosewas introduced to bridge earlier usage. This alias has been removed and all usages now rely on the canonicalclient.Cluster.Nodes.ListVerbose(...)method. Documentation and tests were updated accordingly. No deprecated method will ship—avoiding API clutter.Documentation Additions
REPLICATION_API_USAGE.md: 400+ line usage guide (overview, types, initiating operations, monitoring, management, filtering, advanced patterns, best practices).REPLICATION_IMPLEMENTATION_SUMMARY.md: Architectural summary (files, patterns, tracker design, future enhancements).Updated existing replication references to use
ListVerboseconsistently.Testing & Verification
RequireVersion("1.32.0").ReplicationClientConfig).Migration Notes for Users
ListVerbose(collection)to discover shards and node names.NodesVerbose()references (if copied from early branch previews) withNodes.ListVerbose().Error Handling Patterns
ReplicateAsync: expects200on creation; subsequent GET used for full details.ReplicationDetailsAsync: returnsnullon404(non-existent operation); tracker converts missing operations toWeaviateNotFoundExceptionwhen refreshing.204regardless of prior state) matching OpenAPI spec.Performance Considerations
PollIntervalto reduce load.Future Enhancements (Deferred)
Breaking Changes
None—purely additive features plus internal extension of error handling.
Review Checklist
Please focus review on: API ergonomics (
ReplicatevsReplicateSync), tracker lifecycle/disposal semantics, endpoint status handling, and naming consistency.Let me know if you'd prefer splitting docs into shorter sections or squashing commits before merge.