Dont insert shred payload into rocksdb (#9366)

automerge
This commit is contained in:
anatoly yakovenko
2020-04-16 18:20:55 -07:00
committed by GitHub
parent 66abe45ea1
commit 5ed39de8c5
13 changed files with 501 additions and 322 deletions

View File

@ -5,7 +5,7 @@ use solana_client::rpc_client::RpcClient;
use solana_client::thin_client::create_client;
use solana_core::{
broadcast_stage::BroadcastStageType, consensus::VOTE_THRESHOLD_DEPTH,
gossip_service::discover_cluster, validator::ValidatorConfig,
contact_info::ContactInfo, gossip_service::discover_cluster, validator::ValidatorConfig,
};
use solana_download_utils::download_snapshot;
use solana_ledger::bank_forks::CompressionType;
@ -274,7 +274,7 @@ fn run_cluster_partition(
for node in &cluster_nodes {
let node_client = RpcClient::new_socket(node.rpc);
if let Ok(epoch_info) = node_client.get_epoch_info() {
info!("slots_per_epoch: {:?}", epoch_info);
debug!("slots_per_epoch: {:?}", epoch_info);
if epoch_info.slots_in_epoch <= (1 << VOTE_THRESHOLD_DEPTH) {
reached_epoch = false;
break;
@ -343,13 +343,16 @@ fn run_cluster_partition(
alive_node_contact_infos.len(),
)
.unwrap();
assert!(wait_for_new_roots(&alive_node_contact_infos, 1024, 16));
info!("PARTITION_TEST discovered {} nodes", cluster_nodes.len());
info!("PARTITION_TEST looking for new roots on all nodes");
let mut roots = vec![HashSet::new(); alive_node_contact_infos.len()];
let mut done = false;
}
pub fn wait_for_new_roots(nodes: &[ContactInfo], mut tries: usize, min_roots: usize) -> bool {
info!("looking for new roots on all nodes");
let mut roots = vec![HashSet::new(); nodes.len()];
let mut last_print = Instant::now();
while !done {
for (i, ingress_node) in alive_node_contact_infos.iter().enumerate() {
while tries > 0 {
for (i, ingress_node) in nodes.iter().enumerate() {
let client = create_client(
ingress_node.client_facing_addr(),
solana_core::cluster_info::VALIDATOR_PORT_RANGE,
@ -358,14 +361,24 @@ fn run_cluster_partition(
roots[i].insert(slot);
let min_node = roots.iter().map(|r| r.len()).min().unwrap_or(0);
if last_print.elapsed().as_secs() > 3 {
info!("PARTITION_TEST min observed roots {}/16", min_node);
info!(
"{}: min observed roots {}/{} in {} nodes",
tries,
min_node,
min_roots,
roots.len()
);
last_print = Instant::now();
}
done = min_node >= 16;
if min_node >= min_roots {
return true;
}
}
sleep(Duration::from_millis(clock::DEFAULT_MS_PER_SLOT / 2));
tries -= 1;
}
info!("PARTITION_TEST done waiting for roots");
info!("failed waiting for roots");
false
}
#[allow(unused_attributes)]
@ -863,6 +876,7 @@ fn test_snapshot_download() {
#[test]
#[serial]
fn test_snapshot_restart_tower() {
solana_logger::setup();
// First set up the cluster with 2 nodes
let snapshot_interval_slots = 10;
let num_account_paths = 2;
@ -920,12 +934,11 @@ fn test_snapshot_restart_tower() {
// Use the restarted node as the discovery point so that we get updated
// validator's ContactInfo
let restarted_node_info = cluster.get_contact_info(&validator_id).unwrap();
cluster_tests::spend_and_verify_all_nodes(
&restarted_node_info,
&cluster.funding_keypair,
1,
HashSet::new(),
);
let (cluster_nodes, _) =
discover_cluster(&restarted_node_info.gossip, cluster.validators.len()).unwrap();
assert!(wait_for_new_roots(&cluster_nodes, 512, 16));
}
#[test]