From 55f4e5a541eda9e7cefbd5138b42cdd92c697d17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=82=8E=E6=B3=BC?= Date: Mon, 22 Jul 2024 11:04:48 +0800 Subject: [PATCH] Chore: mark StorageIOError as deprecated --- openraft/src/engine/command.rs | 1 - openraft/src/engine/handler/vote_handler/mod.rs | 3 --- openraft/src/lib.rs | 1 + openraft/src/storage_error.rs | 1 + 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/openraft/src/engine/command.rs b/openraft/src/engine/command.rs index d14ccfec0..04667f0d9 100644 --- a/openraft/src/engine/command.rs +++ b/openraft/src/engine/command.rs @@ -106,7 +106,6 @@ where C: RaftTypeConfig /// inclusive. TruncateLog { since: LogId }, - // TODO(1): current it is only used to replace BuildSnapshot, InstallSnapshot, CancelSnapshot. /// A command send to state machine worker [`sm::worker::Worker`]. /// /// The runtime(`RaftCore`) will just forward this command to [`sm::worker::Worker`]. diff --git a/openraft/src/engine/handler/vote_handler/mod.rs b/openraft/src/engine/handler/vote_handler/mod.rs index 79be4bfb1..b9fc9792a 100644 --- a/openraft/src/engine/handler/vote_handler/mod.rs +++ b/openraft/src/engine/handler/vote_handler/mod.rs @@ -235,9 +235,6 @@ where C: RaftTypeConfig /// /// This node then becomes raft-follower or raft-learner. pub(crate) fn become_following(&mut self) { - // TODO: entering following needs to check last-log-id on other node to decide the election - // timeout. - debug_assert!( self.state.vote_ref().leader_id().voted_for() != Some(self.config.id) || !self.state.membership_state.effective().membership().is_voter(&self.config.id), diff --git a/openraft/src/lib.rs b/openraft/src/lib.rs index af46ce624..4ebc42958 100644 --- a/openraft/src/lib.rs +++ b/openraft/src/lib.rs @@ -113,6 +113,7 @@ pub use crate::storage::StorageHelper; pub use crate::storage_error::ErrorSubject; pub use crate::storage_error::ErrorVerb; pub use crate::storage_error::StorageError; +#[allow(deprecated)] pub use crate::storage_error::StorageIOError; pub use crate::storage_error::ToStorageResult; pub use crate::summary::MessageSummary; diff --git a/openraft/src/storage_error.rs b/openraft/src/storage_error.rs index 375b04ece..4814dc173 100644 --- a/openraft/src/storage_error.rs +++ b/openraft/src/storage_error.rs @@ -84,6 +84,7 @@ impl fmt::Display for ErrorVerb { } /// Backward compatible with old application using `StorageIOError` +#[deprecated(note = "use StorageError instead", since = "0.10.0")] pub type StorageIOError = StorageError; impl StorageError