Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: clean up useless comment about unused state-machine-id #13112

Merged
merged 1 commit into from
Oct 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/meta/raft-store/src/key_spaces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 1 addition & 6 deletions src/meta/service/src/store/store_inner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -371,16 +368,14 @@ impl StoreInner {
&self,
data: Box<SnapshotData>,
) -> Result<(), MetaStorageError> {
//

SMV002::install_snapshot(self.state_machine.clone(), data)
.await
.map_err(|e| {
MetaStorageError::SnapshotError(
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(())
Expand Down
2 changes: 0 additions & 2 deletions src/meta/service/tests/it/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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?;
}

Expand Down
Loading