Repository: qdrant/qdrant
File: lib/collection/src/operations/cluster_ops.rs (Rust)

Code before:
    DropShardingKey(DropShardingKeyOperation),
    /// Restart transfer
    RestartTransfer(RestartTransferOperation),

    /// Start resharding
    StartResharding(StartReshardingOperation),
    /// Finish migrating points on specified shard, mark shard as `Active`
    #[schemars(skip)] // hide for internal use
    FinishMigratingPoints(FinishMigratingPointsOperation),
    /// Commit read hashring
    #[schemars(skip)] // hide for internal use
    CommitReadHashRing(CommitReadHashRingOperation),
    /// Commit write hashring
    #[schemars(skip)] // hide for internal use
    CommitWriteHashRing(CommitWriteHashRingOperation),
    /// Finish resharding
    #[schemars(skip)] // hide for internal use
    FinishResharding(FinishReshardingOperation),
    /// Abort resharding
    AbortResharding(AbortReshardingOperation),
    /// Trigger replication of points between two shards
    ReplicatePoints(ReplicatePointsOperation),

    /// Introduce artificial delay to a node
    #[cfg(feature = "staging")]
    SlowDownNode(SlowDownNodeOperation),
}

#[derive(Debug, Deserialize, Serialize, JsonSchema, Validate, Clone)]
#[serde(rename_all = "snake_case")]
pub struct CreateShardingKeyOperation {
    pub create_sharding_key: CreateShardingKey,
}

#[derive(Debug, Deserialize, Serialize, JsonSchema, Validate, Clone)]
#[serde(rename_all = "snake_case")]
pub struct DropShardingKeyOperation {
    pub drop_sharding_key: DropShardingKey,
}

#[derive(Debug, Deserialize, Serialize, JsonSchema, Validate, Clone)]
#[serde(rename_all = "snake_case")]
pub struct RestartTransferOperation {
    #[validate(nested)]
    pub restart_transfer: RestartTransfer,
}

#[derive(Debug, Deserialize, Serialize, JsonSchema, Validate, Clone)]
#[serde(rename_all = "snake_case")]
pub struct CreateShardingKey {
    pub shard_key: ShardKey,

Review comment (performance):
Nice!

Nit: I suggest to prefix these with 'test', so that they are clearly distinguishable from regular operations even in places where we call them. So it might become `TestSlowDown` and `test_slow_down`.

Wdyt?

Code after:
    DropShardingKey(DropShardingKeyOperation),
    /// Restart transfer
    RestartTransfer(RestartTransferOperation),

    /// Start resharding
    StartResharding(StartReshardingOperation),
    /// Finish migrating points on specified shard, mark shard as `Active`
    #[schemars(skip)] // hide for internal use
    FinishMigratingPoints(FinishMigratingPointsOperation),
    /// Commit read hashring
    #[schemars(skip)] // hide for internal use
    CommitReadHashRing(CommitReadHashRingOperation),
    /// Commit write hashring
    #[schemars(skip)] // hide for internal use
    CommitWriteHashRing(CommitWriteHashRingOperation),
    /// Finish resharding
    #[schemars(skip)] // hide for internal use
    FinishResharding(FinishReshardingOperation),
    /// Abort resharding
    AbortResharding(AbortReshardingOperation),
    /// Trigger replication of points between two shards
    ReplicatePoints(ReplicatePointsOperation),

    /// Introduce artificial delay to a node
    #[cfg(feature = "staging")]
    TestSlowDown(TestSlowDownOperation),
}

#[derive(Debug, Deserialize, Serialize, JsonSchema, Validate, Clone)]
#[serde(rename_all = "snake_case")]
pub struct CreateShardingKeyOperation {
    pub create_sharding_key: CreateShardingKey,
}

#[derive(Debug, Deserialize, Serialize, JsonSchema, Validate, Clone)]
#[serde(rename_all = "snake_case")]
pub struct DropShardingKeyOperation {
    pub drop_sharding_key: DropShardingKey,
}

#[derive(Debug, Deserialize, Serialize, JsonSchema, Validate, Clone)]
#[serde(rename_all = "snake_case")]
pub struct RestartTransferOperation {
    #[validate(nested)]
    pub restart_transfer: RestartTransfer,
}

#[derive(Debug, Deserialize, Serialize, JsonSchema, Validate, Clone)]
#[serde(rename_all = "snake_case")]
pub struct CreateShardingKey {
    pub shard_key: ShardKey,