* Prematurely abort blocking task in `spawn_cancel_on_drop` on drop
These tasks are intended to be cancellable. Now we prematurely abort the
task if the future was dropped before the task is executed.
* Prematurely abort blocking task in `spawn_cancel_on_token` on cancel
These tasks are intended to be cancellable. Now we prematurely abort the
task if the cancellation token is triggered before the task is executed.
* Prematurely abort blocking task for fetching telemetry
* Prematurely abort stoppable task on drop, all are safe to abort early
* Make `move_dir` either move everything, or nothing at all
That is with the exception of file IO errors in which case data may be
partially moved.
Before this PR it was possible for the new target directory to be
created without moving all data into it. Now we either do all, or
nothing.
* Prematurely abort task for creating full snapshot
It is fine to either create it, or not at all.
* Prematurely abort blocking task for waiting on consensus leader
* Prematurely abort blocking cardinality estimation and shard info tasks
* Prematurely abort blocking point deduplication task
* Prematurely abort blocking task for checking available disk space
* Prematurely abort blocking shard read operations
All shard read operations, such as retrieve, scroll, facets and more can
be safely aborted prematurely.
Related to: <https://github.com/qdrant/qdrant/pull/7530>
* Prematurely abort blocking task for waiting on replica state
* Prematurely abort blocking task for waiting on transfer replica states
* Prematurely abort blocking task for loading segment
This can safely be aborted before the task is started
* Prematurely abort blocking task waiting for replica states
* Prematurely abort blocking task for creating snapshot file
Safe because it aborts before writing any snapshot files to disk
* Bump Rust edition to 2024
* gen is a reserved keyword now
* Remove ref mut on references
* Mark extern C as unsafe
* Wrap unsafe function bodies in unsafe block
* Geo hash implements Copy, don't reference but pass by value instead
* Replace secluded self import with parent
* Update execute_cluster_read_operation with new match semantics
* Fix lifetime issue
* Replace map_or with is_none_or
* set_var is unsafe now
* Reformat
* make mmap_type independent from segment structures
* make bitvec and thiserror workspace dependencies
* move mmap_type into common/memory subcrate
* fmt
* Ensure shard snapshot methods and API are cancel safe
* Remove resolved TODOs
* Extend comment on why we don't unproxify queue in a normal way
* fixup! Remove resolved TODOs
* Restructure `spawn_transfer_task`
* Update lib/collection/src/shards/transfer/shard_transfer.rs
Co-authored-by: Roman Titov <ffuugoo@users.noreply.github.com>
* fixup! Restructure `spawn_transfer_task`
Make `spawn_transfer_task` more readable
---------
Co-authored-by: timvisee <tim@visee.me>
Co-authored-by: Tim Visée <tim+github@visee.me>
* Define cancel safety for some queue proxy methods
* Add cancel safety documentation to future cancellation functions
* Various code improvements
* Add cancellation token to queue proxy finalize method
* Add cancellation token to queue proxy finalize method
* Also clean up queue proxy if transfer is cancelled
* Update cancellation comments
* WIP: Make shard snapshot methods and API to be safely cancellable
* WIP: Annotate all shard snapshot API methods if they are safe to cancel...
...and what should be done to make them so
* WIP: Fix/clarify annotations for methods that can't be made safe to cancel
* WIP: Further clarify cancel-safe annotations
* Make shard snapshot methods cancel-safe...
...or annotate and propagate cancellation tokens to them
* Fix spelling
* Explicitly cancel snapshot archive task in `ShardHolder::create_shard_snapshot`
* WIP: Make `recover_shard_snapshot`/`upload_shard_snapshot` API cancel-safe
* Make `recover_shard_snapshot`/`upload_shard_snapshot` API cancel-safe
* Add `common/cancel-safe` sub-crate
* Cleanup
* Rename `cancel-safe` sub-crate to `cancel`...
...and rename methods to have more meaningful names
* fixup! Rename `cancel-safe` sub-crate to `cancel`...
* Remove explicit `tokio-util` dependency from the `qdrant` crate
`common/cancel` re-exports important parts anyway
* Documentation fixes
* Do not cancel request processing if request is dropped
* Rename `common/cancel` APIs
* Fix (or drop) some TODOs
* Fix `clippy` and `cargo fmt`
* fixup! Rename `common/cancel` APIs
Fix typo
* Improve documentation and comments
* Fix failing shard snapshot API test
* Use conventional cancel safety notes
---------
Co-authored-by: timvisee <tim@visee.me>