Repository navigation
Conversation
Changelog PreviewThis PR lands in these workspaces:
📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features
🤖 This preview updates automatically when you update the PR. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## aldy505/feat/change-stream/sqlite-garbage-collector #747 +/- ##
=======================================================================================
+ Coverage 91.58% 91.61% +0.02%
=======================================================================================
Files 121 122 +1
Lines 23898 23991 +93
=======================================================================================
+ Hits 21887 21979 +92
- Misses 2011 2012 +1
☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
|
||
| async fn commit_delete(&self, id: &ObjectId) { | ||
| self.storage.remove(id).await | ||
| } |
There was a problem hiding this comment.
Delete can drop in-flight writes
Medium Severity
commit_delete removes the GC index entry with no sequencing against an in-flight write. A concurrent begin_write can record a deadline, then commit_delete can drop it, after which the write still succeeds. Because commit_write is a no-op, that object is never re-indexed and will not be collected.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit aaad2fb. Configure here.
There was a problem hiding this comment.
I think this behavior is acceptable. Should we guard the begin_write expiry time to be more than some seconds?
aaad2fb to
1c21602
Compare
1c21602 to
a897eb6
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a897eb6. Configure here.
| expires_at: Option<Timestamp>, | ||
| ) -> Result<(), ChangeStreamError> { | ||
| self.storage.upsert(id, expires_at).await | ||
| } |
There was a problem hiding this comment.
Failed non-expiring write blocks later GC
Low Severity
begin_write and begin_update upsert None before the storage operation commits. GcStorage::upsert never replaces a missing deadline with a shorter finite one, so a failed never-expiring write leaves a sticky None that a later successful TTL write of the same id cannot overwrite, and that object is never collected.
Reviewed by Cursor Bugbot for commit a897eb6. Configure here.


Stack created with GitHub Stacks CLI • Give Feedback 💬