Repository: qdrant/qdrant
File: lib/collection/src/shards/local_shard/mod.rs (Rust)

Code before:
                })
                .merge_independent()
        });
        let cardinality = AbortOnDropHandle::new(cardinality).await?;
        Ok(cardinality)
    }

    pub async fn read_filtered<'a>(
        &'a self,
        filter: Option<&'a Filter>,
        runtime_handle: &Handle,
        hw_counter: HwMeasurementAcc,
        timeout: Option<Duration>,
    ) -> CollectionResult<BTreeSet<PointIdType>> {
        let segments = self.segments.clone();
        SegmentsSearcher::read_filtered(segments, filter, runtime_handle, hw_counter, timeout).await
    }

    pub async fn local_update_queue_info(&self) -> UpdateQueueInfo {
        let last_applied_seq = self.applied_seq_handler.op_num().map(|s| s as usize);
        let length = self.update_queue_length();
        UpdateQueueInfo {
            length,
            last_applied_seq,
        }
    }

    pub async fn local_shard_status(&self) -> (ShardStatus, OptimizersStatus) {
        {
            let segments = self.segments.clone();

            let has_errored_optimizers = tokio::task::spawn_blocking(move || {
                let segments = segments.read(); // blocking sync lock
                // Red status on failed operation or optimizer error
                if !segments.failed_operation.is_empty() || segments.optimizer_errors.is_some() {
                    let optimizer_status = segments
                        .optimizer_errors
                        .as_ref()
                        .map_or(OptimizersStatus::Ok, |err| {
                            OptimizersStatus::Error(err.clone())
                        });
                    return Some((ShardStatus::Red, optimizer_status));
                }

                // Yellow status if we have a special segment, indicates a proxy segment used during optimization
                // TODO: snapshotting also creates temp proxy segments. should differentiate.
                let has_special_segment = segments
                    .iter()
                    .map(|(_, segment)| segment.get().read().info().segment_type)
                    .any(|segment_type| segment_type == SegmentType::Special);
                if has_special_segment {

Review comment (suggestion):
Nit: remove async, make compact.

```suggestion
    pub fn local_update_queue_info(&self) -> UpdateQueueInfo {
        UpdateQueueInfo {
            length: self.update_queue_length(),
            last_applied_seq: self.applied_seq_handler.op_num().map(|s| s as usize),
        }
    }
```

Code after:
                })
                .merge_independent()
        });
        let cardinality = AbortOnDropHandle::new(cardinality).await?;
        Ok(cardinality)
    }

    pub async fn read_filtered<'a>(
        &'a self,
        filter: Option<&'a Filter>,
        runtime_handle: &Handle,
        hw_counter: HwMeasurementAcc,
        timeout: Option<Duration>,
    ) -> CollectionResult<BTreeSet<PointIdType>> {
        let segments = self.segments.clone();
        SegmentsSearcher::read_filtered(segments, filter, runtime_handle, hw_counter, timeout).await
    }

    pub fn local_update_queue_info(&self) -> UpdateQueueInfo {
        UpdateQueueInfo {
            length: self.update_queue_length(),
            op_num: self.applied_seq_handler.op_num().map(|s| s as usize),
        }
    }

    pub async fn local_shard_status(&self) -> (ShardStatus, OptimizersStatus) {
        {
            let segments = self.segments.clone();

            let has_errored_optimizers = tokio::task::spawn_blocking(move || {
                let segments = segments.read(); // blocking sync lock
                // Red status on failed operation or optimizer error
                if !segments.failed_operation.is_empty() || segments.optimizer_errors.is_some() {
                    let optimizer_status = segments
                        .optimizer_errors
                        .as_ref()
                        .map_or(OptimizersStatus::Ok, |err| {
                            OptimizersStatus::Error(err.clone())
                        });
                    return Some((ShardStatus::Red, optimizer_status));
                }

                // Yellow status if we have a special segment, indicates a proxy segment used during optimization
                // TODO: snapshotting also creates temp proxy segments. should differentiate.
                let has_special_segment = segments
                    .iter()
                    .map(|(_, segment)| segment.get().read().info().segment_type)
                    .any(|segment_type| segment_type == SegmentType::Special);
                if has_special_segment {
                    Some((ShardStatus::Yellow, OptimizersStatus::Ok))
                } else {