Fail early when encountering out-of-storage during optimization#4578
Fail early when encountering out-of-storage during optimization#4578generall merged 6 commits intoqdrant:test/low-disk-indexingfrom xhjkl:ood
Conversation
|
💵 To receive payouts, sign up on Algora, link your Github account and connect with Stripe. |
I don't see problem with it. Async FS is fake anyway.
There are no guarantees about it indeed, some external process can occupy the disk and we can do nothing about it |
Understood. Thank you for commenting on that 🙏
Yeah, that's my thoughts precisely: that's why I made the needed space as two times the space already taken — just to be doubly sure there's no jitter. |
* Add test for OOD during indexing * Start indexing right after 1st OOD message * Only send search request after insert loop * Fail early when encountering out-of-storage during optimization (#4578) * fs4@0.8.4 * fail early on low storage * move `dir_size` to `common` * move the ood bailout to `SegmentOptimizer::optimized_segment_builder` * drop dead code * move dir_size to common subcrate --------- Co-authored-by: generall <andrey@vasnetsov.com> --------- Co-authored-by: xhjkl <xhjkl@users.noreply.github.com> Co-authored-by: generall <andrey@vasnetsov.com>
* Add test for OOD during indexing * Start indexing right after 1st OOD message * Only send search request after insert loop * Fail early when encountering out-of-storage during optimization (#4578) * fs4@0.8.4 * fail early on low storage * move `dir_size` to `common` * move the ood bailout to `SegmentOptimizer::optimized_segment_builder` * drop dead code * move dir_size to common subcrate --------- Co-authored-by: generall <andrey@vasnetsov.com> --------- Co-authored-by: xhjkl <xhjkl@users.noreply.github.com> Co-authored-by: generall <andrey@vasnetsov.com>
/claim #4297
All Submissions:
devbranch. Did you create your branch fromdev?What this does is checks if there is twice as much free space on the volume as what the collection being optimized already takes.
I'm not happy with this, and I'm not sure this submission worth the hassle as it is, but I'd like to compare opinions.
Why it's bad
CollectionError::Cancelled.What else have I tried
db.put_cf_opt; it first happens somewhere aroundlib/segment/src/segment_constructor/segment_builder.rs:197, but I could not find a way to cleanly rollback a partially done optimization.DiskUsageWatcherto do the checking before the optimization starts, but it does not have a dynamic threshold, so far as I understand it, and overall it gets a larger change that doing how it's done now.check_environmentto the traitSegmentOptimizerin the same spirit as the existingSegmentOptimizer::check_conditionso that all the implementors could tailor it to their taste, but for now this approach adds no value.