fix: ensure database cleanup precedes vector store deletion (#378, #379)#448
fix: ensure database cleanup precedes vector store deletion (#378, #379)#448EnjoyBacon7 wants to merge 1 commit into
Conversation
…t divergence (#378, #379) Reorder delete operations so relational data is cleaned up before vector store deletion. If vector store delete fails after database cleanup succeeds, the data model remains consistent (data is gone from database, orphaned chunks logged for reconciliation). Changes: - dispatcher.delete_file: remove from workspaces/database first, then Milvus - partition_service.delete_partition: delete from database first, then Milvus - Add error handling and structured logging for reconciliation tasks - Add regression tests verifying correct operation order and error handling Fixes #378 (replace-file keeps old chunks if PG fails) Fixes #379 (partition and file deletes diverge Milvus from PG)
|
Warning Review limit reached
More reviews will be available in 3 minutes and 49 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Fixes data divergence issues where Milvus and Postgres get out of sync during delete operations.
Problem
Solution
Reorder delete operations so relational database cleanup happens first, then vector store deletion:
Changes
dispatcher.delete_file (Issue #378)
partition_service.delete_partition (Issue #379)
Data Consistency Guarantee
✅ Success case: Both DB and Milvus cleaned up
✅ DB succeeds, Milvus fails: File/partition gone from DB (authoritative), orphaned chunks logged for reconciliation
✅ DB fails: Transaction rolls back, both stores remain unchanged
Test Coverage
✅ Added 4 new regression tests:
✅ All 1049 unit tests pass
✅ CI: API Tests ✅, Unit Tests ✅, Integration Tests ✅, Layer Guard ✅
Files Modified
Fixes #378 #379