Revert "Add ledger tool to remove dead slot (#20810) (#20813)"

This reverts commit d1ca16e9f8.
This commit is contained in:
Trent Nelson
2021-12-13 08:48:40 -07:00
committed by Tao Zhu
parent 03db11eb3a
commit 7210a883eb
2 changed files with 1 additions and 32 deletions

View File

@ -1032,20 +1032,6 @@ fn main() {
.help("Slots to mark dead"),
)
)
.subcommand(
SubCommand::with_name("remove-dead-slot")
.about("Remove the dead flag for a slot")
.arg(
Arg::with_name("slots")
.index(1)
.value_name("SLOTS")
.validator(is_slot)
.takes_value(true)
.multiple(true)
.required(true)
.help("Slots to mark as not dead"),
)
)
.subcommand(
SubCommand::with_name("genesis")
.about("Prints the ledger's genesis config")
@ -1777,20 +1763,7 @@ fn main() {
for slot in slots {
match blockstore.set_dead_slot(slot) {
Ok(_) => println!("Slot {} dead", slot),
Err(err) => eprintln!("Failed to set slot {} dead slot: {:?}", slot, err),
}
}
}
("remove-dead-slot", Some(arg_matches)) => {
let slots = values_t_or_exit!(arg_matches, "slots", Slot);
let blockstore =
open_blockstore(&ledger_path, AccessType::PrimaryOnly, wal_recovery_mode);
for slot in slots {
match blockstore.remove_dead_slot(slot) {
Ok(_) => println!("Slot {} not longer marked dead", slot),
Err(err) => {
eprintln!("Failed to remove dead flag for slot {}, {:?}", slot, err)
}
Err(err) => eprintln!("Failed to set slot {} dead slot: {}", slot, err),
}
}
}

View File

@ -3054,10 +3054,6 @@ impl Blockstore {
self.dead_slots_cf.put(slot, &true)
}
pub fn remove_dead_slot(&self, slot: Slot) -> Result<()> {
self.dead_slots_cf.delete(slot)
}
pub fn store_duplicate_if_not_existing(
&self,
slot: Slot,