Skip to content

use mutex to ensure sequential segment flushed + await on drop#7416

Merged
generall merged 1 commit intodevfrom
await-for-segment-flush-before-drop
Oct 17, 2025
Merged

use mutex to ensure sequential segment flushed + await on drop#7416
generall merged 1 commit intodevfrom
await-for-segment-flush-before-drop

Conversation

@generall
Copy link
Member

Fixes

2025-10-17T11:12:20.503980Z ERROR collection::update_handler: Failed to flush: Service runtime error: Failed to flush id_tracker mapping: Service runtime error: IO Error: failed to open file `./storage/collections/benchmark/0/segments/1a570d1b-07c5-4c40-8adf-d7a8ada7030d/mutable_id_tracker.mappings`: No such file or directory (os error 2)

introduced in #7388

@generall generall requested a review from timvisee October 17, 2025 11:15
@qdrant qdrant deleted a comment from coderabbitai bot Oct 17, 2025
coderabbitai[bot]

This comment was marked as resolved.

Comment on lines +692 to +701
let is_alive_flush_lock = self.is_alive_flush_lock.clone();

let flush_op = move || {
// Keep the guard till the end of the flush to prevent concurrent flushes
let is_alive_flush_guard = is_alive_flush_lock.lock();

if !*is_alive_flush_guard {
// Segment is removed, skip flush
return Ok(());
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer a separate Mutex<()> and stopped flag, I think. It's a mechanism we use already, and then we can more easily propagate the flag throughout the rest of the flusher operation.

But it's not critical. Let's merge this and revisit it if it ever becomes important.

@qdrant qdrant deleted a comment from coderabbitai bot Oct 17, 2025
@generall generall merged commit 037c272 into dev Oct 17, 2025
15 checks passed
@generall generall deleted the await-for-segment-flush-before-drop branch October 17, 2025 11:49
@timvisee timvisee mentioned this pull request Nov 14, 2025
@timvisee timvisee mentioned this pull request Dec 8, 2025
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants