-
Notifications
You must be signed in to change notification settings - Fork 2k
[ENH] Support a read-only mode for the rust log service. #5534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Testing:
rust-fronten… │ 2025-09-30T15:03:08.056409Z ERROR error: Failed to push logs: status: PermissionDenied, message: "service is in read-only mode", details: [], metadata: MetadataMap { headers: {"content-type": "application/grpc", "date": "Tue, 30 Sep 2025 15:03:07 GMT", "content-length": "0"} }
rust-fronten… │ at rust/log/src/log.rs:96
rust-fronten… │ in push_logs with tenant: "default_tenant", collection_id: CollectionUuid(e101eb7d-69e9-4473-9cee-27ced3c39b53)
rust-fronten… │ in collection_add
rust-fronten… │ in HTTP request with http.method: POST, http.uri: /api/v2/tenants/default_tenant/databases/test_54f26162-81f4-4f1b-9c18-8e884d5537f1/collections/e101eb7d-69e9-4473-9cee-27ced3c39b53/add, http.route: "/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/add", http.version: HTTP/1.1, http.host: localhost:8000, http.user_agent: Chroma Python Client v1.1.0 (https://github.com/chroma-core/chroma), otel.name: "POST /api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/add"
|
Add Read-Only Mode to This pull request introduces a configurable read-only mode to the Key Changes• Added Affected Areas• This summary was automatically generated by @propel-code-bot |
Reviewer ChecklistPlease leverage this checklist to ensure your code review is thorough before approving Testing, Bugs, Errors, Logs, Documentation
System Compatibility
Quality
|
rust/log-service/src/lib.rs
Outdated
| if self.config.is_read_only() { | ||
| return Err(Status::permission_denied("service is in read-only mode")); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[BestPractice]
This read-only check appears to be redundant. The two functions that call _update_collection_log_offset (update_collection_log_offset and rollback_collection_log_offset) already perform this same check. Removing this one would avoid the redundant check.
| if self.config.is_read_only() { | |
| return Err(Status::permission_denied("service is in read-only mode")); | |
| } |
⚡ Committable suggestion
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
Context for Agents
[**BestPractice**]
This read-only check appears to be redundant. The two functions that call `_update_collection_log_offset` (`update_collection_log_offset` and `rollback_collection_log_offset`) already perform this same check. Removing this one would avoid the redundant check.
```suggestion
```
⚡ **Committable suggestion**
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
File: rust/log-service/src/lib.rs
Line: 613| &self, | ||
| request: Request<UpdateCollectionLogOffsetRequest>, | ||
| ) -> Result<Response<UpdateCollectionLogOffsetResponse>, Status> { | ||
| self.ensure_write_mode()?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[BestPractice]
This ensure_write_mode() check is redundant because this function calls _update_collection_log_offset, which already performs the same check at line 617. You can remove this line to avoid duplication.
Context for Agents
[**BestPractice**]
This `ensure_write_mode()` check is redundant because this function calls `_update_collection_log_offset`, which already performs the same check at line 617. You can remove this line to avoid duplication.
File: rust/log-service/src/lib.rs
Line: 1510| &self, | ||
| request: Request<UpdateCollectionLogOffsetRequest>, | ||
| ) -> Result<Response<UpdateCollectionLogOffsetResponse>, Status> { | ||
| self.ensure_write_mode()?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[BestPractice]
Similar to update_collection_log_offset, this ensure_write_mode() check is redundant. The called function _update_collection_log_offset already handles this check. This line can be removed to avoid duplication.
Context for Agents
[**BestPractice**]
Similar to `update_collection_log_offset`, this `ensure_write_mode()` check is redundant. The called function `_update_collection_log_offset` already handles this check. This line can be removed to avoid duplication.
File: rust/log-service/src/lib.rs
Line: 1528
Description of changes
Add a read-only mode to the rust log service so it can be brought up for DR.
Test plan
Tested in tilt:
Migration plan
N/A
Observability plan
N/A
Documentation Changes
N/A