adds fallback & metric for when epoch staked-nodes are none
This commit is contained in:
parent
50d0e830c9
commit
fb69f45f14
|
@ -257,9 +257,18 @@ impl<T: 'static> ClusterNodesCache<T> {
|
||||||
cache.pop(&epoch);
|
cache.pop(&epoch);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let epoch_staked_nodes = root_bank.epoch_staked_nodes(epoch).unwrap_or_default();
|
let epoch_staked_nodes = root_bank.epoch_staked_nodes(epoch);
|
||||||
let nodes = new_cluster_nodes::<T>(cluster_info, &epoch_staked_nodes);
|
if epoch_staked_nodes.is_none() {
|
||||||
let nodes = Arc::new(nodes);
|
inc_new_counter_info!("cluster_nodes-unknown_epoch_staked_nodes", 1);
|
||||||
|
if epoch != root_bank.get_leader_schedule_epoch(root_bank.slot()) {
|
||||||
|
return self.get(root_bank.slot(), root_bank, cluster_info);
|
||||||
|
}
|
||||||
|
inc_new_counter_info!("cluster_nodes-unknown_epoch_staked_nodes_root", 1);
|
||||||
|
}
|
||||||
|
let nodes = Arc::new(new_cluster_nodes::<T>(
|
||||||
|
cluster_info,
|
||||||
|
&epoch_staked_nodes.unwrap_or_default(),
|
||||||
|
));
|
||||||
{
|
{
|
||||||
let mut cache = self.cache.lock().unwrap();
|
let mut cache = self.cache.lock().unwrap();
|
||||||
cache.put(epoch, (Instant::now(), Arc::clone(&nodes)));
|
cache.put(epoch, (Instant::now(), Arc::clone(&nodes)));
|
||||||
|
|
Loading…
Reference in New Issue