-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Always run cancellation handle for interrupted optimizations #6549
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
Always run cancellation handle for interrupted optimizations #6549
Conversation
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.
There's still some places where we might error without handling cancellation, for example:
qdrant/lib/collection/src/collection_manager/optimizers/segment_optimizer.rs
Lines 713 to 728 in d36e0dc
ProxyIndexChange::Create(schema, version) => { | |
optimized_segment.create_field_index( | |
*version, | |
field_name, | |
Some(schema), | |
&hw_counter, | |
)?; | |
} | |
ProxyIndexChange::Delete(version) => { | |
optimized_segment.delete_field_index(*version, field_name)?; | |
} | |
ProxyIndexChange::DeleteIfIncompatible(version, schema) => { | |
optimized_segment | |
.delete_field_index_if_incompatible(*version, field_name, schema)?; | |
} | |
} |
I think it'd be best to handle those too, possibly by moving everything that works with proxies into a sub-function.
This comment was marked as resolved.
This comment was marked as resolved.
@@ -10,7 +10,7 @@ use common::disk::dir_size; | |||
use io::storage_version::StorageVersion; | |||
use itertools::Itertools; | |||
use parking_lot::{Mutex, RwLockUpgradableReadGuard}; | |||
use segment::common::operation_error::{OperationResult, check_process_stopped}; |
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.
I have unified the code file on on the local self.check_cancellation
to not have two styles.
* Always run cancelletatiob handle for interrupted optimizations * Stick to one way of checking cancelation * Move segment optimization in sub function, cancel in single place (#6557) * Move segment optimization into separate function, cancel in single place * Don't use owned lock * Unify cancellation check --------- Co-authored-by: Tim Visée <tim+github@visee.me>
* Always run cancelletatiob handle for interrupted optimizations * Stick to one way of checking cancelation * Move segment optimization in sub function, cancel in single place (#6557) * Move segment optimization into separate function, cancel in single place * Don't use owned lock * Unify cancellation check --------- Co-authored-by: Tim Visée <tim+github@visee.me>
Seems to fix Crasher, will let CI chew on it.
This PR makes sure we handle the on going proxy segments when failing with any error to build a new optimized segment.