From e166531202fb6bd69e2394710e2fb4d8b2ab54f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=82=8E=E6=B3=BC?= Date: Sun, 8 Oct 2023 08:40:59 +0800 Subject: [PATCH] chore: clean up useless comment about unused state-machine-id --- src/meta/raft-store/src/key_spaces.rs | 2 +- src/meta/service/src/store/store_inner.rs | 7 +------ src/meta/service/tests/it/store.rs | 2 -- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/meta/raft-store/src/key_spaces.rs b/src/meta/raft-store/src/key_spaces.rs index ad59d0c08ed5..fd0d1bfff298 100644 --- a/src/meta/raft-store/src/key_spaces.rs +++ b/src/meta/raft-store/src/key_spaces.rs @@ -78,7 +78,7 @@ impl SledKeySpace for StateMachineMeta { } /// Key-Value Types for storing meta data of a raft in sled::Tree: -/// node_id, vote, state_machine_id pairs:(a,b) +/// node_id, vote pub struct RaftStateKV {} impl SledKeySpace for RaftStateKV { const PREFIX: u8 = 4; diff --git a/src/meta/service/src/store/store_inner.rs b/src/meta/service/src/store/store_inner.rs index d01a79bd0cd6..f3c0844a139f 100644 --- a/src/meta/service/src/store/store_inner.rs +++ b/src/meta/service/src/store/store_inner.rs @@ -138,9 +138,6 @@ impl StoreInner { let log = RaftLog::open(&db, config).await?; info!("RaftLog opened"); - // TODO(1): remove read_state_machine_id(); - // TODO(1): StateMachine::clean() - fn to_startup_err(e: impl std::error::Error + 'static) -> MetaStartupError { let ae = AnyError::new(&e); let store_err = MetaStorageError::SnapshotError(ae); @@ -371,8 +368,6 @@ impl StoreInner { &self, data: Box, ) -> Result<(), MetaStorageError> { - // - SMV002::install_snapshot(self.state_machine.clone(), data) .await .map_err(|e| { @@ -380,7 +375,7 @@ impl StoreInner { AnyError::new(&e).add_context(|| "replacing state-machine with snapshot"), ) })?; - // TODO(1): read_state_machine_id() and write_state_machine_id() is no longer used. + // TODO(xp): use checksum to check consistency? Ok(()) diff --git a/src/meta/service/tests/it/store.rs b/src/meta/service/tests/it/store.rs index 68b7725ab6ed..849ae23c8ddd 100644 --- a/src/meta/service/tests/it/store.rs +++ b/src/meta/service/tests/it/store.rs @@ -242,8 +242,6 @@ async fn test_meta_store_install_snapshot() -> anyhow::Result<()> { info!("--- install snapshot"); { - // TODO(1): remove write_state_machine_id - // sto.raft_state.write_state_machine_id(&(0, 0)).await?; sto.do_install_snapshot(data).await?; }