diff --git a/crates/libs/core/src/runtime/stateful.rs b/crates/libs/core/src/runtime/stateful.rs index 440380b..d2b726c 100644 --- a/crates/libs/core/src/runtime/stateful.rs +++ b/crates/libs/core/src/runtime/stateful.rs @@ -9,7 +9,7 @@ use mssf_com::FabricRuntime::IFabricStatefulServicePartition; use crate::sync::CancellationToken; use crate::types::{LoadMetric, LoadMetricListRef, ReplicaRole}; -use crate::types::{Epoch, OpenMode, ReplicaInformation, ReplicaSetConfig, ReplicaSetQuarumMode}; +use crate::types::{Epoch, OpenMode, ReplicaInformation, ReplicaSetConfig, ReplicaSetQuorumMode}; /// Represents a stateful service factory that is responsible for creating replicas /// of a specific type of stateful service. Stateful service factories are registered with @@ -135,7 +135,7 @@ pub trait LocalPrimaryReplicator: Replicator { ) -> crate::Result<()>; async fn wait_for_catch_up_quorum( &self, - catchupmode: ReplicaSetQuarumMode, + catchupmode: ReplicaSetQuorumMode, cancellation_token: CancellationToken, ) -> crate::Result<()>; fn update_current_replica_set_configuration( diff --git a/crates/libs/core/src/runtime/stateful_proxy.rs b/crates/libs/core/src/runtime/stateful_proxy.rs index 423fd52..c6a2736 100644 --- a/crates/libs/core/src/runtime/stateful_proxy.rs +++ b/crates/libs/core/src/runtime/stateful_proxy.rs @@ -24,7 +24,7 @@ use crate::{ use super::stateful::{ PrimaryReplicator, Replicator, StatefulServicePartition, StatefulServiceReplica, }; -use crate::types::{Epoch, OpenMode, ReplicaInformation, ReplicaSetConfig, ReplicaSetQuarumMode}; +use crate::types::{Epoch, OpenMode, ReplicaInformation, ReplicaSetConfig, ReplicaSetQuorumMode}; pub struct StatefulServiceReplicaProxy { com_impl: IFabricStatefulServiceReplica, @@ -259,7 +259,7 @@ impl PrimaryReplicator for PrimaryReplicatorProxy { } async fn wait_for_catch_up_quorum( &self, - catchupmode: ReplicaSetQuarumMode, + catchupmode: ReplicaSetQuorumMode, cancellation_token: CancellationToken, ) -> crate::Result<()> { info!("PrimaryReplicatorProxy::wait_for_catch_up_quorum: catchupmode {catchupmode:?}"); diff --git a/crates/libs/core/src/types/runtime/stateful.rs b/crates/libs/core/src/types/runtime/stateful.rs index 52e5c3d..6b03bb7 100644 --- a/crates/libs/core/src/types/runtime/stateful.rs +++ b/crates/libs/core/src/types/runtime/stateful.rs @@ -260,29 +260,29 @@ impl ReplicaInformation { // FABRIC_REPLICA_SET_QUORUM_MODE #[derive(Debug, Clone, PartialEq)] -pub enum ReplicaSetQuarumMode { +pub enum ReplicaSetQuorumMode { All, Invalid, Write, } -impl From for ReplicaSetQuarumMode { +impl From for ReplicaSetQuorumMode { fn from(r: FABRIC_REPLICA_SET_QUORUM_MODE) -> Self { match r { - FABRIC_REPLICA_SET_QUORUM_ALL => ReplicaSetQuarumMode::All, - FABRIC_REPLICA_SET_QUORUM_INVALID => ReplicaSetQuarumMode::Invalid, - FABRIC_REPLICA_SET_WRITE_QUORUM => ReplicaSetQuarumMode::Write, - _ => ReplicaSetQuarumMode::Invalid, + FABRIC_REPLICA_SET_QUORUM_ALL => ReplicaSetQuorumMode::All, + FABRIC_REPLICA_SET_QUORUM_INVALID => ReplicaSetQuorumMode::Invalid, + FABRIC_REPLICA_SET_WRITE_QUORUM => ReplicaSetQuorumMode::Write, + _ => ReplicaSetQuorumMode::Invalid, } } } -impl From for FABRIC_REPLICA_SET_QUORUM_MODE { - fn from(val: ReplicaSetQuarumMode) -> Self { +impl From for FABRIC_REPLICA_SET_QUORUM_MODE { + fn from(val: ReplicaSetQuorumMode) -> Self { match val { - ReplicaSetQuarumMode::All => FABRIC_REPLICA_SET_QUORUM_ALL, - ReplicaSetQuarumMode::Invalid => FABRIC_REPLICA_SET_QUORUM_INVALID, - ReplicaSetQuarumMode::Write => FABRIC_REPLICA_SET_WRITE_QUORUM, + ReplicaSetQuorumMode::All => FABRIC_REPLICA_SET_QUORUM_ALL, + ReplicaSetQuorumMode::Invalid => FABRIC_REPLICA_SET_QUORUM_INVALID, + ReplicaSetQuorumMode::Write => FABRIC_REPLICA_SET_WRITE_QUORUM, } } } diff --git a/crates/samples/echomain-stateful2/src/statefulstore.rs b/crates/samples/echomain-stateful2/src/statefulstore.rs index 98a8a18..6eb9895 100644 --- a/crates/samples/echomain-stateful2/src/statefulstore.rs +++ b/crates/samples/echomain-stateful2/src/statefulstore.rs @@ -12,7 +12,7 @@ use mssf_core::{ }, }, types::{ - Epoch, OpenMode, ReplicaInformation, ReplicaRole, ReplicaSetConfig, ReplicaSetQuarumMode, + Epoch, OpenMode, ReplicaInformation, ReplicaRole, ReplicaSetConfig, ReplicaSetQuorumMode, }, }; use mssf_core::{Error, HSTRING}; @@ -122,7 +122,7 @@ impl PrimaryReplicator for AppFabricReplicator { async fn wait_for_catch_up_quorum( &self, - _catchupmode: ReplicaSetQuarumMode, + _catchupmode: ReplicaSetQuorumMode, _: CancellationToken, ) -> mssf_core::Result<()> { info!("AppFabricReplicator2::PrimaryReplicator::wait_for_catch_up_quorum");