Revert "Factor repair from gossip (#8044)" (#8143)

This reverts commit e61257695f.
This commit is contained in:
carllin
2020-02-06 11:44:20 -08:00
committed by GitHub
parent a7fa92b372
commit fe590da3b6
13 changed files with 605 additions and 816 deletions

View File

@@ -16,7 +16,6 @@ use solana_core::{
packet::{limited_deserialize, PACKET_DATA_SIZE},
repair_service,
repair_service::{RepairService, RepairSlotRange, RepairStrategy},
serve_repair::ServeRepair,
shred_fetch_stage::ShredFetchStage,
sigverify_stage::{DisabledSigVerifier, SigVerifyStage},
storage_stage::NUM_STORAGE_SAMPLES,
@@ -196,7 +195,13 @@ impl Archiver {
Blockstore::open(ledger_path).expect("Expected to be able to open database ledger"),
);
let gossip_service = GossipService::new(&cluster_info, None, node.sockets.gossip, &exit);
let gossip_service = GossipService::new(
&cluster_info,
Some(blockstore.clone()),
None,
node.sockets.gossip,
&exit,
);
info!("Connecting to the cluster via {:?}", cluster_entrypoint);
let (nodes, _) =
@@ -809,7 +814,7 @@ impl Archiver {
/// It is recommended to use a temporary blockstore for this since the download will not verify
/// shreds received and might impact the chaining of shreds across slots
pub fn download_from_archiver(
serve_repair: &ServeRepair,
cluster_info: &Arc<RwLock<ClusterInfo>>,
archiver_info: &ContactInfo,
blockstore: &Arc<Blockstore>,
slots_per_segment: u64,
@@ -829,10 +834,10 @@ impl Archiver {
Recycler::default(),
"archiver_reeciver",
);
let id = serve_repair.keypair().pubkey();
let id = cluster_info.read().unwrap().id();
info!(
"Sending repair requests from: {} to: {}",
serve_repair.my_info().id,
cluster_info.read().unwrap().my_data().id,
archiver_info.gossip
);
let repair_slot_range = RepairSlotRange {
@@ -852,7 +857,9 @@ impl Archiver {
let reqs: Vec<_> = repairs
.into_iter()
.filter_map(|repair_request| {
serve_repair
cluster_info
.read()
.unwrap()
.map_repair_request(&repair_request)
.map(|result| ((archiver_info.gossip, result), repair_request))
.ok()