Repository: qdrant/qdrant
File: src/actix/api/update_api.rs (Rust)

Code before:
    use collection::operations::verification::new_unchecked_verification_pass;
    use ordered_float::OrderedFloat;
    use shard::operations::CollectionUpdateOperations;
    use shard::operations::staging::TestDelayOperation;

    let timing = Instant::now();
    let operation = operation.into_inner();
    let collection_name = collection.into_inner().name;

    let point_operation = PointOperations::TestDelay(TestDelayOperation {
        duration: OrderedFloat(operation.duration),
    });

    let collection_operation = CollectionUpdateOperations::PointOperation(point_operation);

    // Get TOC with unchecked verification pass (staging operations don't need strict mode)
    let pass = new_unchecked_verification_pass();
    let toc = dispatcher.toc(&access, &pass);

    let result = crate::common::update::update(
        toc,
        &collection_name,
        collection_operation,
        InternalUpdateParams::default(),
        UpdateParams {
            wait: true,
            ordering: Default::default(),
        },
        None, // shard_key
        access,
        HwMeasurementAcc::disposable(),
    )
    .await;

    process_response(result, timing, None)
}

// Configure services
pub fn config_update_api(cfg: &mut web::ServiceConfig) {
    cfg.service(upsert_points)
        .service(delete_points)
        .service(update_vectors)
        .service(delete_vectors)
        .service(set_payload)
        .service(overwrite_payload)
        .service(delete_payload)
        .service(clear_payload)
        .service(create_field_index)
        .service(delete_field_index)
        .service(update_batch);


Review comment (suggestion):
I think it's reasonable to grab the `wait` param from API parameters.

It is useful to just block updates, and not the whole test.

Let's use the `UpdateParams` struct and also include ordering: https://github.com/qdrant/qdrant/blob/ec6cce8291be0e135e4c21dbfd9292690c1f0b24/src/actix/api/update_api.rs#L37

Code after:
    use collection::operations::point_ops::PointOperations;
    use collection::operations::verification::new_unchecked_verification_pass;
    use shard::operations::CollectionUpdateOperations;
    use shard::operations::staging::TestDelayOperation;

    let timing = Instant::now();
    let operation = operation.into_inner();
    let collection_name = collection.into_inner().name;

    let point_operation = PointOperations::TestDelay(TestDelayOperation::new(operation.duration));

    let collection_operation = CollectionUpdateOperations::PointOperation(point_operation);

    // Get TOC with unchecked verification pass (staging operations don't need strict mode)
    let pass = new_unchecked_verification_pass();
    let toc = dispatcher.toc(&access, &pass);

    let result = crate::common::update::update(
        toc,
        &collection_name,
        collection_operation,
        InternalUpdateParams::default(),
        params.into_inner(),
        None, // shard_key
        access,
        HwMeasurementAcc::disposable(),
    )
    .await;

    process_response(result, timing, None)
}

// Configure services
pub fn config_update_api(cfg: &mut web::ServiceConfig) {
    cfg.service(upsert_points)
        .service(delete_points)
        .service(update_vectors)
        .service(delete_vectors)
        .service(set_payload)
        .service(overwrite_payload)
        .service(delete_payload)
        .service(clear_payload)
        .service(create_field_index)
        .service(delete_field_index)
        .service(update_batch);

    #[cfg(feature = "staging")]
    cfg.service(staging_test_delay);
}