Allow contact debug interval to be adjusted (#13737)
This commit is contained in:
parent
ed82bf70f5
commit
c1eb350c47
|
@ -107,6 +107,7 @@ const MAX_PRUNE_DATA_NODES: usize = 32;
|
||||||
const GOSSIP_PING_TOKEN_SIZE: usize = 32;
|
const GOSSIP_PING_TOKEN_SIZE: usize = 32;
|
||||||
const GOSSIP_PING_CACHE_CAPACITY: usize = 16384;
|
const GOSSIP_PING_CACHE_CAPACITY: usize = 16384;
|
||||||
const GOSSIP_PING_CACHE_TTL: Duration = Duration::from_secs(640);
|
const GOSSIP_PING_CACHE_TTL: Duration = Duration::from_secs(640);
|
||||||
|
pub const DEFAULT_CONTACT_DEBUG_INTERVAL: u64 = 10_000;
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Eq)]
|
#[derive(Debug, PartialEq, Eq)]
|
||||||
pub enum ClusterInfoError {
|
pub enum ClusterInfoError {
|
||||||
|
@ -298,6 +299,7 @@ pub struct ClusterInfo {
|
||||||
stats: GossipStats,
|
stats: GossipStats,
|
||||||
socket: UdpSocket,
|
socket: UdpSocket,
|
||||||
local_message_pending_push_queue: RwLock<Vec<(CrdsValue, u64)>>,
|
local_message_pending_push_queue: RwLock<Vec<(CrdsValue, u64)>>,
|
||||||
|
contact_debug_interval: u64,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for ClusterInfo {
|
impl Default for ClusterInfo {
|
||||||
|
@ -553,6 +555,7 @@ impl ClusterInfo {
|
||||||
stats: GossipStats::default(),
|
stats: GossipStats::default(),
|
||||||
socket: UdpSocket::bind("0.0.0.0:0").unwrap(),
|
socket: UdpSocket::bind("0.0.0.0:0").unwrap(),
|
||||||
local_message_pending_push_queue: RwLock::new(vec![]),
|
local_message_pending_push_queue: RwLock::new(vec![]),
|
||||||
|
contact_debug_interval: DEFAULT_CONTACT_DEBUG_INTERVAL,
|
||||||
};
|
};
|
||||||
{
|
{
|
||||||
let mut gossip = me.gossip.write().unwrap();
|
let mut gossip = me.gossip.write().unwrap();
|
||||||
|
@ -586,9 +589,14 @@ impl ClusterInfo {
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.clone(),
|
.clone(),
|
||||||
),
|
),
|
||||||
|
contact_debug_interval: self.contact_debug_interval,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn set_contact_debug_interval(&mut self, new: u64) {
|
||||||
|
self.contact_debug_interval = new;
|
||||||
|
}
|
||||||
|
|
||||||
pub fn update_contact_info<F>(&self, modify: F)
|
pub fn update_contact_info<F>(&self, modify: F)
|
||||||
where
|
where
|
||||||
F: FnOnce(&mut ContactInfo),
|
F: FnOnce(&mut ContactInfo),
|
||||||
|
@ -1792,7 +1800,9 @@ impl ClusterInfo {
|
||||||
loop {
|
loop {
|
||||||
let start = timestamp();
|
let start = timestamp();
|
||||||
thread_mem_usage::datapoint("solana-gossip");
|
thread_mem_usage::datapoint("solana-gossip");
|
||||||
if start - last_contact_info_trace > 10000 {
|
if self.contact_debug_interval != 0
|
||||||
|
&& start - last_contact_info_trace > self.contact_debug_interval
|
||||||
|
{
|
||||||
// Log contact info every 10 seconds
|
// Log contact info every 10 seconds
|
||||||
info!(
|
info!(
|
||||||
"\n{}\n\n{}",
|
"\n{}\n\n{}",
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
broadcast_stage::BroadcastStageType,
|
broadcast_stage::BroadcastStageType,
|
||||||
cache_block_time_service::{CacheBlockTimeSender, CacheBlockTimeService},
|
cache_block_time_service::{CacheBlockTimeSender, CacheBlockTimeService},
|
||||||
cluster_info::{ClusterInfo, Node},
|
cluster_info::{ClusterInfo, Node, DEFAULT_CONTACT_DEBUG_INTERVAL},
|
||||||
cluster_info_vote_listener::VoteTracker,
|
cluster_info_vote_listener::VoteTracker,
|
||||||
completed_data_sets_service::CompletedDataSetsService,
|
completed_data_sets_service::CompletedDataSetsService,
|
||||||
consensus::{reconcile_blockstore_roots_with_tower, Tower},
|
consensus::{reconcile_blockstore_roots_with_tower, Tower},
|
||||||
|
@ -105,6 +105,7 @@ pub struct ValidatorConfig {
|
||||||
pub cuda: bool,
|
pub cuda: bool,
|
||||||
pub require_tower: bool,
|
pub require_tower: bool,
|
||||||
pub debug_keys: Option<Arc<HashSet<Pubkey>>>,
|
pub debug_keys: Option<Arc<HashSet<Pubkey>>>,
|
||||||
|
pub contact_debug_interval: u64,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for ValidatorConfig {
|
impl Default for ValidatorConfig {
|
||||||
|
@ -140,6 +141,7 @@ impl Default for ValidatorConfig {
|
||||||
cuda: false,
|
cuda: false,
|
||||||
require_tower: false,
|
require_tower: false,
|
||||||
debug_keys: None,
|
debug_keys: None,
|
||||||
|
contact_debug_interval: DEFAULT_CONTACT_DEBUG_INTERVAL,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -333,10 +335,9 @@ impl Validator {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let cluster_info = Arc::new(ClusterInfo::new(
|
let mut cluster_info = ClusterInfo::new(node.info.clone(), identity_keypair.clone());
|
||||||
node.info.clone(),
|
cluster_info.set_contact_debug_interval(config.contact_debug_interval);
|
||||||
identity_keypair.clone(),
|
let cluster_info = Arc::new(cluster_info);
|
||||||
));
|
|
||||||
let mut block_commitment_cache = BlockCommitmentCache::default();
|
let mut block_commitment_cache = BlockCommitmentCache::default();
|
||||||
block_commitment_cache.initialize_slots(bank.slot());
|
block_commitment_cache.initialize_slots(bank.slot());
|
||||||
let block_commitment_cache = Arc::new(RwLock::new(block_commitment_cache));
|
let block_commitment_cache = Arc::new(RwLock::new(block_commitment_cache));
|
||||||
|
|
|
@ -1099,6 +1099,14 @@ pub fn main() {
|
||||||
.help("Number of slots between generating snapshots, \
|
.help("Number of slots between generating snapshots, \
|
||||||
0 to disable snapshots"),
|
0 to disable snapshots"),
|
||||||
)
|
)
|
||||||
|
.arg(
|
||||||
|
Arg::with_name("contact_debug_interval")
|
||||||
|
.long("contact-debug-interval")
|
||||||
|
.value_name("CONTACT_DEBUG_INTERVAL")
|
||||||
|
.takes_value(true)
|
||||||
|
.default_value("10000")
|
||||||
|
.help("Milliseconds between printing contact debug from gossip."),
|
||||||
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("accounts_hash_interval_slots")
|
Arg::with_name("accounts_hash_interval_slots")
|
||||||
.long("accounts-hash-slots")
|
.long("accounts-hash-slots")
|
||||||
|
@ -1435,6 +1443,8 @@ pub fn main() {
|
||||||
bind_address
|
bind_address
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let contact_debug_interval = value_t_or_exit!(matches, "contact_debug_interval", u64);
|
||||||
|
|
||||||
let restricted_repair_only_mode = matches.is_present("restricted_repair_only_mode");
|
let restricted_repair_only_mode = matches.is_present("restricted_repair_only_mode");
|
||||||
let mut validator_config = ValidatorConfig {
|
let mut validator_config = ValidatorConfig {
|
||||||
require_tower: matches.is_present("require_tower"),
|
require_tower: matches.is_present("require_tower"),
|
||||||
|
@ -1499,6 +1509,7 @@ pub fn main() {
|
||||||
wal_recovery_mode,
|
wal_recovery_mode,
|
||||||
poh_verify: !matches.is_present("skip_poh_verify"),
|
poh_verify: !matches.is_present("skip_poh_verify"),
|
||||||
debug_keys,
|
debug_keys,
|
||||||
|
contact_debug_interval,
|
||||||
..ValidatorConfig::default()
|
..ValidatorConfig::default()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue