Add UpdatesGuard type wrapper for updates_guard#8031
Add UpdatesGuard type wrapper for updates_guard#8031generall merged 5 commits intofaster-segment-holder-locksfrom
Conversation
|
@copilot this doesn't change anything |
Co-authored-by: generall <1935623+generall@users.noreply.github.com>
I've now implemented the type wrapper. Created a newtype Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot fix linter issues |
Co-authored-by: generall <1935623+generall@users.noreply.github.com>
|
|
||
| impl<'a> UpdatesGuard<'a> { | ||
| /// Create a new UpdatesGuard from a MutexGuard. | ||
| fn new(guard: parking_lot::MutexGuard<'a, ()>) -> Self { |
There was a problem hiding this comment.
I don't think new is needed. Tuple struct constructor is enough the single usage, and new is not public (and shouldn't be).
There was a problem hiding this comment.
Removed the unnecessary new() method. Now using the tuple constructor directly: UpdatesGuard(self.updates_mutex.lock()). Changes in commit 74f5353.
|
@copilot fix linter and comments |
Co-authored-by: generall <1935623+generall@users.noreply.github.com>
* non-locking retrieve * optimization & write exclusive lock via upgradable_read * faster segment holder locks debug (#8024) * fix deadlock * move LockedSegmentHolder into a dedicated file * reorder locks for snapshot * fmt * upd comments * Update lib/collection/src/collection_manager/optimizers/segment_optimizer.rs Co-authored-by: Ivan Boldyrev <ivan.boldyrev@qdrant.com> * Add UpdatesGuard type wrapper for updates_guard (#8031) * Initial plan * Add UpdatesGuard newtype wrapper for updates_guard Co-authored-by: generall <1935623+generall@users.noreply.github.com> * Fix linter issue - remove trailing space in doc comment Co-authored-by: generall <1935623+generall@users.noreply.github.com> * Remove unnecessary new() method, use tuple constructor directly Co-authored-by: generall <1935623+generall@users.noreply.github.com> * fix clippy --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: generall <1935623+generall@users.noreply.github.com> Co-authored-by: generall <andrey@vasnetsov.com> * Remove aliassed lifetime Co-authored-by: Jojii <15957865+JojiiOfficial@users.noreply.github.com> --------- Co-authored-by: Ivan Boldyrev <ivan.boldyrev@qdrant.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: generall <1935623+generall@users.noreply.github.com> Co-authored-by: Tim Visée <tim+github@visee.me> Co-authored-by: Jojii <15957865+JojiiOfficial@users.noreply.github.com>
* non-locking retrieve * optimization & write exclusive lock via upgradable_read * faster segment holder locks debug (#8024) * fix deadlock * move LockedSegmentHolder into a dedicated file * reorder locks for snapshot * fmt * upd comments * Update lib/collection/src/collection_manager/optimizers/segment_optimizer.rs Co-authored-by: Ivan Boldyrev <ivan.boldyrev@qdrant.com> * Add UpdatesGuard type wrapper for updates_guard (#8031) * Initial plan * Add UpdatesGuard newtype wrapper for updates_guard Co-authored-by: generall <1935623+generall@users.noreply.github.com> * Fix linter issue - remove trailing space in doc comment Co-authored-by: generall <1935623+generall@users.noreply.github.com> * Remove unnecessary new() method, use tuple constructor directly Co-authored-by: generall <1935623+generall@users.noreply.github.com> * fix clippy --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: generall <1935623+generall@users.noreply.github.com> Co-authored-by: generall <andrey@vasnetsov.com> * Remove aliassed lifetime Co-authored-by: Jojii <15957865+JojiiOfficial@users.noreply.github.com> --------- Co-authored-by: Ivan Boldyrev <ivan.boldyrev@qdrant.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: generall <1935623+generall@users.noreply.github.com> Co-authored-by: Tim Visée <tim+github@visee.me> Co-authored-by: Jojii <15957865+JojiiOfficial@users.noreply.github.com>
UpdatesGuardforparking_lot::MutexGuard<'_, ()>segment_holder/snapshot.rsto use the new typeacquire_updates_lockmethod to return the new typenew()method, use tuple constructor directly💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.