report additional transaction errors to metrics (#28285)
This commit is contained in:
parent
f4dd24491f
commit
0324573667
|
@ -109,6 +109,11 @@ struct LeaderSlotPacketCountMetrics {
|
||||||
// `self.retrayble_errored_transaction_count`.
|
// `self.retrayble_errored_transaction_count`.
|
||||||
account_lock_throttled_transactions_count: u64,
|
account_lock_throttled_transactions_count: u64,
|
||||||
|
|
||||||
|
// total number of transactions that were excluded from the block because their write
|
||||||
|
// account locks exceed the limit.
|
||||||
|
// These transactions are not retried.
|
||||||
|
account_locks_limit_throttled_transactions_count: u64,
|
||||||
|
|
||||||
// total number of transactions that were excluded from the block because they were too expensive
|
// total number of transactions that were excluded from the block because they were too expensive
|
||||||
// according to the cost model. These transactions are added back to the buffered queue and are
|
// according to the cost model. These transactions are added back to the buffered queue and are
|
||||||
// already counted in `self.retrayble_errored_transaction_count`.
|
// already counted in `self.retrayble_errored_transaction_count`.
|
||||||
|
@ -207,6 +212,11 @@ impl LeaderSlotPacketCountMetrics {
|
||||||
self.account_lock_throttled_transactions_count as i64,
|
self.account_lock_throttled_transactions_count as i64,
|
||||||
i64
|
i64
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
"account_locks_limit_throttled_transactions_count",
|
||||||
|
self.account_locks_limit_throttled_transactions_count as i64,
|
||||||
|
i64
|
||||||
|
),
|
||||||
(
|
(
|
||||||
"cost_model_throttled_transactions_count",
|
"cost_model_throttled_transactions_count",
|
||||||
self.cost_model_throttled_transactions_count as i64,
|
self.cost_model_throttled_transactions_count as i64,
|
||||||
|
@ -459,6 +469,13 @@ impl LeaderSlotMetricsTracker {
|
||||||
error_counters.account_in_use as u64
|
error_counters.account_in_use as u64
|
||||||
);
|
);
|
||||||
|
|
||||||
|
saturating_add_assign!(
|
||||||
|
leader_slot_metrics
|
||||||
|
.packet_count_metrics
|
||||||
|
.account_locks_limit_throttled_transactions_count,
|
||||||
|
error_counters.too_many_account_locks as u64
|
||||||
|
);
|
||||||
|
|
||||||
saturating_add_assign!(
|
saturating_add_assign!(
|
||||||
leader_slot_metrics
|
leader_slot_metrics
|
||||||
.packet_count_metrics
|
.packet_count_metrics
|
||||||
|
|
|
@ -4542,14 +4542,32 @@ impl Bank {
|
||||||
.iter()
|
.iter()
|
||||||
.enumerate()
|
.enumerate()
|
||||||
.filter_map(|(index, res)| match res {
|
.filter_map(|(index, res)| match res {
|
||||||
|
// following are retryable errors
|
||||||
Err(TransactionError::AccountInUse) => {
|
Err(TransactionError::AccountInUse) => {
|
||||||
error_counters.account_in_use += 1;
|
error_counters.account_in_use += 1;
|
||||||
Some(index)
|
Some(index)
|
||||||
}
|
}
|
||||||
Err(TransactionError::WouldExceedMaxBlockCostLimit)
|
Err(TransactionError::WouldExceedMaxBlockCostLimit) => {
|
||||||
| Err(TransactionError::WouldExceedMaxVoteCostLimit)
|
error_counters.would_exceed_max_block_cost_limit += 1;
|
||||||
| Err(TransactionError::WouldExceedMaxAccountCostLimit)
|
Some(index)
|
||||||
| Err(TransactionError::WouldExceedAccountDataBlockLimit) => Some(index),
|
}
|
||||||
|
Err(TransactionError::WouldExceedMaxVoteCostLimit) => {
|
||||||
|
error_counters.would_exceed_max_vote_cost_limit += 1;
|
||||||
|
Some(index)
|
||||||
|
}
|
||||||
|
Err(TransactionError::WouldExceedMaxAccountCostLimit) => {
|
||||||
|
error_counters.would_exceed_max_account_cost_limit += 1;
|
||||||
|
Some(index)
|
||||||
|
}
|
||||||
|
Err(TransactionError::WouldExceedAccountDataBlockLimit) => {
|
||||||
|
error_counters.would_exceed_account_data_block_limit += 1;
|
||||||
|
Some(index)
|
||||||
|
}
|
||||||
|
// following are non-retryable errors
|
||||||
|
Err(TransactionError::TooManyAccountLocks) => {
|
||||||
|
error_counters.too_many_account_locks += 1;
|
||||||
|
None
|
||||||
|
}
|
||||||
Err(_) => None,
|
Err(_) => None,
|
||||||
Ok(_) => None,
|
Ok(_) => None,
|
||||||
})
|
})
|
||||||
|
|
|
@ -4,6 +4,7 @@ use solana_sdk::{clock::Slot, saturating_add_assign};
|
||||||
pub struct TransactionErrorMetrics {
|
pub struct TransactionErrorMetrics {
|
||||||
pub total: usize,
|
pub total: usize,
|
||||||
pub account_in_use: usize,
|
pub account_in_use: usize,
|
||||||
|
pub too_many_account_locks: usize,
|
||||||
pub account_loaded_twice: usize,
|
pub account_loaded_twice: usize,
|
||||||
pub account_not_found: usize,
|
pub account_not_found: usize,
|
||||||
pub blockhash_not_found: usize,
|
pub blockhash_not_found: usize,
|
||||||
|
@ -18,6 +19,10 @@ pub struct TransactionErrorMetrics {
|
||||||
pub not_allowed_during_cluster_maintenance: usize,
|
pub not_allowed_during_cluster_maintenance: usize,
|
||||||
pub invalid_writable_account: usize,
|
pub invalid_writable_account: usize,
|
||||||
pub invalid_rent_paying_account: usize,
|
pub invalid_rent_paying_account: usize,
|
||||||
|
pub would_exceed_max_block_cost_limit: usize,
|
||||||
|
pub would_exceed_max_account_cost_limit: usize,
|
||||||
|
pub would_exceed_max_vote_cost_limit: usize,
|
||||||
|
pub would_exceed_account_data_block_limit: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl TransactionErrorMetrics {
|
impl TransactionErrorMetrics {
|
||||||
|
@ -28,6 +33,7 @@ impl TransactionErrorMetrics {
|
||||||
pub fn accumulate(&mut self, other: &TransactionErrorMetrics) {
|
pub fn accumulate(&mut self, other: &TransactionErrorMetrics) {
|
||||||
saturating_add_assign!(self.total, other.total);
|
saturating_add_assign!(self.total, other.total);
|
||||||
saturating_add_assign!(self.account_in_use, other.account_in_use);
|
saturating_add_assign!(self.account_in_use, other.account_in_use);
|
||||||
|
saturating_add_assign!(self.too_many_account_locks, other.too_many_account_locks);
|
||||||
saturating_add_assign!(self.account_loaded_twice, other.account_loaded_twice);
|
saturating_add_assign!(self.account_loaded_twice, other.account_loaded_twice);
|
||||||
saturating_add_assign!(self.account_not_found, other.account_not_found);
|
saturating_add_assign!(self.account_not_found, other.account_not_found);
|
||||||
saturating_add_assign!(self.blockhash_not_found, other.blockhash_not_found);
|
saturating_add_assign!(self.blockhash_not_found, other.blockhash_not_found);
|
||||||
|
@ -54,6 +60,22 @@ impl TransactionErrorMetrics {
|
||||||
self.invalid_rent_paying_account,
|
self.invalid_rent_paying_account,
|
||||||
other.invalid_rent_paying_account
|
other.invalid_rent_paying_account
|
||||||
);
|
);
|
||||||
|
saturating_add_assign!(
|
||||||
|
self.would_exceed_max_block_cost_limit,
|
||||||
|
other.would_exceed_max_block_cost_limit
|
||||||
|
);
|
||||||
|
saturating_add_assign!(
|
||||||
|
self.would_exceed_max_account_cost_limit,
|
||||||
|
other.would_exceed_max_account_cost_limit
|
||||||
|
);
|
||||||
|
saturating_add_assign!(
|
||||||
|
self.would_exceed_max_vote_cost_limit,
|
||||||
|
other.would_exceed_max_vote_cost_limit
|
||||||
|
);
|
||||||
|
saturating_add_assign!(
|
||||||
|
self.would_exceed_account_data_block_limit,
|
||||||
|
other.would_exceed_account_data_block_limit
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn report(&self, id: u32, slot: Slot) {
|
pub fn report(&self, id: u32, slot: Slot) {
|
||||||
|
@ -63,6 +85,11 @@ impl TransactionErrorMetrics {
|
||||||
("slot", slot as i64, i64),
|
("slot", slot as i64, i64),
|
||||||
("total", self.total as i64, i64),
|
("total", self.total as i64, i64),
|
||||||
("account_in_use", self.account_in_use as i64, i64),
|
("account_in_use", self.account_in_use as i64, i64),
|
||||||
|
(
|
||||||
|
"too_many_account_locks",
|
||||||
|
self.too_many_account_locks as i64,
|
||||||
|
i64
|
||||||
|
),
|
||||||
(
|
(
|
||||||
"account_loaded_twice",
|
"account_loaded_twice",
|
||||||
self.account_loaded_twice as i64,
|
self.account_loaded_twice as i64,
|
||||||
|
@ -105,6 +132,26 @@ impl TransactionErrorMetrics {
|
||||||
self.invalid_rent_paying_account as i64,
|
self.invalid_rent_paying_account as i64,
|
||||||
i64
|
i64
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
"would_exceed_max_block_cost_limit",
|
||||||
|
self.would_exceed_max_block_cost_limit as i64,
|
||||||
|
i64
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"would_exceed_max_account_cost_limit",
|
||||||
|
self.would_exceed_max_account_cost_limit as i64,
|
||||||
|
i64
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"would_exceed_max_vote_cost_limit",
|
||||||
|
self.would_exceed_max_vote_cost_limit as i64,
|
||||||
|
i64
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"would_exceed_account_data_block_limit",
|
||||||
|
self.would_exceed_account_data_block_limit as i64,
|
||||||
|
i64
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue