Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
someone235 committed Oct 25, 2023
1 parent 25023d5 commit af3a7a8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions components/consensusmanager/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ impl StagingConsensus {
for handle in self.handles {
handle.join().unwrap();
}
drop(self.staging);
self.manager.delete_staging_entry();
}
}
Expand Down
2 changes: 0 additions & 2 deletions consensus/src/consensus/ctl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ impl ConsensusCtl for Ctl {
fn make_active(&self) {
// TODO: pass a value to make sure the correct consensus is committed
self.management_store.write().commit_staging_consensus().unwrap();

// TODO: delete previous active
}
}

Expand Down
6 changes: 3 additions & 3 deletions consensus/src/consensus/factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,8 @@ impl ConsensusFactory for Factory {
}

fn clean_non_active_consensus_entries(&self) {
self.delete_staging_entry();

if self.config.is_archival {
return;
}
Expand Down Expand Up @@ -339,9 +341,7 @@ impl ConsensusFactory for Factory {
warn!("Couldn't delete staging consensus entry {}: {}", entry.key, e);
}
};
} else {
warn!("Couldn't delete staging consensus entry: entry was not found");
write_guard.cancel_staging_consensus().unwrap();
}
self.management_store.write().cancel_staging_consensus().unwrap();
}
}

0 comments on commit af3a7a8

Please sign in to comment.