skip_rewrites will only be feature driven (#29468)
This commit is contained in:
parent
64466725d4
commit
4cc1890f00
|
@ -1378,13 +1378,6 @@ fn main() {
|
||||||
let no_os_memory_stats_reporting_arg = Arg::with_name("no_os_memory_stats_reporting")
|
let no_os_memory_stats_reporting_arg = Arg::with_name("no_os_memory_stats_reporting")
|
||||||
.long("no-os-memory-stats-reporting")
|
.long("no-os-memory-stats-reporting")
|
||||||
.help("Disable reporting of OS memory statistics.");
|
.help("Disable reporting of OS memory statistics.");
|
||||||
let skip_rewrites_arg = Arg::with_name("accounts_db_skip_rewrites")
|
|
||||||
.long("accounts-db-skip-rewrites")
|
|
||||||
.help(
|
|
||||||
"Accounts that are rent exempt and have no changes are not rewritten. \
|
|
||||||
This produces snapshots that older versions cannot read.",
|
|
||||||
)
|
|
||||||
.hidden(true);
|
|
||||||
let accounts_db_skip_initial_hash_calc_arg =
|
let accounts_db_skip_initial_hash_calc_arg =
|
||||||
Arg::with_name("accounts_db_skip_initial_hash_calculation")
|
Arg::with_name("accounts_db_skip_initial_hash_calculation")
|
||||||
.long("accounts-db-skip-initial-hash-calculation")
|
.long("accounts-db-skip-initial-hash-calculation")
|
||||||
|
@ -1777,7 +1770,6 @@ fn main() {
|
||||||
.arg(&accounts_filler_count)
|
.arg(&accounts_filler_count)
|
||||||
.arg(&accounts_filler_size)
|
.arg(&accounts_filler_size)
|
||||||
.arg(&verify_index_arg)
|
.arg(&verify_index_arg)
|
||||||
.arg(&skip_rewrites_arg)
|
|
||||||
.arg(&accounts_db_skip_initial_hash_calc_arg)
|
.arg(&accounts_db_skip_initial_hash_calc_arg)
|
||||||
.arg(&ancient_append_vecs)
|
.arg(&ancient_append_vecs)
|
||||||
.arg(&halt_at_slot_store_hash_raw_data)
|
.arg(&halt_at_slot_store_hash_raw_data)
|
||||||
|
@ -1835,7 +1827,6 @@ fn main() {
|
||||||
.about("Create a new ledger snapshot")
|
.about("Create a new ledger snapshot")
|
||||||
.arg(&no_snapshot_arg)
|
.arg(&no_snapshot_arg)
|
||||||
.arg(&account_paths_arg)
|
.arg(&account_paths_arg)
|
||||||
.arg(&skip_rewrites_arg)
|
|
||||||
.arg(&accounts_db_skip_initial_hash_calc_arg)
|
.arg(&accounts_db_skip_initial_hash_calc_arg)
|
||||||
.arg(&ancient_append_vecs)
|
.arg(&ancient_append_vecs)
|
||||||
.arg(&hard_forks_arg)
|
.arg(&hard_forks_arg)
|
||||||
|
@ -2733,7 +2724,6 @@ fn main() {
|
||||||
index: Some(accounts_index_config),
|
index: Some(accounts_index_config),
|
||||||
accounts_hash_cache_path: Some(ledger_path.clone()),
|
accounts_hash_cache_path: Some(ledger_path.clone()),
|
||||||
filler_accounts_config,
|
filler_accounts_config,
|
||||||
skip_rewrites: arg_matches.is_present("accounts_db_skip_rewrites"),
|
|
||||||
ancient_append_vec_offset: value_t!(
|
ancient_append_vec_offset: value_t!(
|
||||||
matches,
|
matches,
|
||||||
"accounts_db_ancient_append_vecs",
|
"accounts_db_ancient_append_vecs",
|
||||||
|
@ -3002,7 +2992,6 @@ fn main() {
|
||||||
);
|
);
|
||||||
|
|
||||||
let accounts_db_config = Some(AccountsDbConfig {
|
let accounts_db_config = Some(AccountsDbConfig {
|
||||||
skip_rewrites: arg_matches.is_present("accounts_db_skip_rewrites"),
|
|
||||||
ancient_append_vec_offset: value_t!(
|
ancient_append_vec_offset: value_t!(
|
||||||
matches,
|
matches,
|
||||||
"accounts_db_ancient_append_vecs",
|
"accounts_db_ancient_append_vecs",
|
||||||
|
|
|
@ -353,7 +353,6 @@ pub const ACCOUNTS_DB_CONFIG_FOR_TESTING: AccountsDbConfig = AccountsDbConfig {
|
||||||
accounts_hash_cache_path: None,
|
accounts_hash_cache_path: None,
|
||||||
filler_accounts_config: FillerAccountsConfig::const_default(),
|
filler_accounts_config: FillerAccountsConfig::const_default(),
|
||||||
write_cache_limit_bytes: None,
|
write_cache_limit_bytes: None,
|
||||||
skip_rewrites: false,
|
|
||||||
ancient_append_vec_offset: None,
|
ancient_append_vec_offset: None,
|
||||||
skip_initial_hash_calc: false,
|
skip_initial_hash_calc: false,
|
||||||
exhaustively_verify_refcounts: false,
|
exhaustively_verify_refcounts: false,
|
||||||
|
@ -363,7 +362,6 @@ pub const ACCOUNTS_DB_CONFIG_FOR_BENCHMARKS: AccountsDbConfig = AccountsDbConfig
|
||||||
accounts_hash_cache_path: None,
|
accounts_hash_cache_path: None,
|
||||||
filler_accounts_config: FillerAccountsConfig::const_default(),
|
filler_accounts_config: FillerAccountsConfig::const_default(),
|
||||||
write_cache_limit_bytes: None,
|
write_cache_limit_bytes: None,
|
||||||
skip_rewrites: false,
|
|
||||||
ancient_append_vec_offset: None,
|
ancient_append_vec_offset: None,
|
||||||
skip_initial_hash_calc: false,
|
skip_initial_hash_calc: false,
|
||||||
exhaustively_verify_refcounts: false,
|
exhaustively_verify_refcounts: false,
|
||||||
|
@ -420,7 +418,6 @@ pub struct AccountsDbConfig {
|
||||||
pub accounts_hash_cache_path: Option<PathBuf>,
|
pub accounts_hash_cache_path: Option<PathBuf>,
|
||||||
pub filler_accounts_config: FillerAccountsConfig,
|
pub filler_accounts_config: FillerAccountsConfig,
|
||||||
pub write_cache_limit_bytes: Option<u64>,
|
pub write_cache_limit_bytes: Option<u64>,
|
||||||
pub skip_rewrites: bool,
|
|
||||||
/// if None, ancient append vecs are disabled
|
/// if None, ancient append vecs are disabled
|
||||||
/// Some(offset) means include slots up to (max_slot - (slots_per_epoch - 'offset'))
|
/// Some(offset) means include slots up to (max_slot - (slots_per_epoch - 'offset'))
|
||||||
pub ancient_append_vec_offset: Option<Slot>,
|
pub ancient_append_vec_offset: Option<Slot>,
|
||||||
|
@ -1268,9 +1265,6 @@ pub struct AccountsDb {
|
||||||
/// slot that is one epoch older than the highest slot where accounts hash calculation has completed
|
/// slot that is one epoch older than the highest slot where accounts hash calculation has completed
|
||||||
pub accounts_hash_complete_one_epoch_old: RwLock<Slot>,
|
pub accounts_hash_complete_one_epoch_old: RwLock<Slot>,
|
||||||
|
|
||||||
/// true iff rent exempt accounts are not rewritten in their normal rent collection slot
|
|
||||||
pub skip_rewrites: bool,
|
|
||||||
|
|
||||||
/// Some(offset) iff we want to squash old append vecs together into 'ancient append vecs'
|
/// Some(offset) iff we want to squash old append vecs together into 'ancient append vecs'
|
||||||
/// Some(offset) means for slots up to (max_slot - (slots_per_epoch - 'offset')), put them in ancient append vecs
|
/// Some(offset) means for slots up to (max_slot - (slots_per_epoch - 'offset')), put them in ancient append vecs
|
||||||
pub ancient_append_vec_offset: Option<Slot>,
|
pub ancient_append_vec_offset: Option<Slot>,
|
||||||
|
@ -2298,7 +2292,6 @@ impl AccountsDb {
|
||||||
filler_account_slots_remaining: AtomicU64::default(),
|
filler_account_slots_remaining: AtomicU64::default(),
|
||||||
active_stats: ActiveStats::default(),
|
active_stats: ActiveStats::default(),
|
||||||
accounts_hash_complete_one_epoch_old: RwLock::default(),
|
accounts_hash_complete_one_epoch_old: RwLock::default(),
|
||||||
skip_rewrites: false,
|
|
||||||
skip_initial_hash_calc: false,
|
skip_initial_hash_calc: false,
|
||||||
ancient_append_vec_offset: None,
|
ancient_append_vec_offset: None,
|
||||||
accounts_index,
|
accounts_index,
|
||||||
|
@ -2396,10 +2389,6 @@ impl AccountsDb {
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.map(|config| config.filler_accounts_config)
|
.map(|config| config.filler_accounts_config)
|
||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
let skip_rewrites = accounts_db_config
|
|
||||||
.as_ref()
|
|
||||||
.map(|config| config.skip_rewrites)
|
|
||||||
.unwrap_or_default();
|
|
||||||
let skip_initial_hash_calc = accounts_db_config
|
let skip_initial_hash_calc = accounts_db_config
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.map(|config| config.skip_initial_hash_calc)
|
.map(|config| config.skip_initial_hash_calc)
|
||||||
|
@ -2423,7 +2412,6 @@ impl AccountsDb {
|
||||||
let paths_is_empty = paths.is_empty();
|
let paths_is_empty = paths.is_empty();
|
||||||
let mut new = Self {
|
let mut new = Self {
|
||||||
paths,
|
paths,
|
||||||
skip_rewrites,
|
|
||||||
skip_initial_hash_calc,
|
skip_initial_hash_calc,
|
||||||
ancient_append_vec_offset,
|
ancient_append_vec_offset,
|
||||||
cluster_type: Some(*cluster_type),
|
cluster_type: Some(*cluster_type),
|
||||||
|
|
|
@ -5335,7 +5335,7 @@ impl Bank {
|
||||||
Vec::<(&Pubkey, &AccountSharedData)>::with_capacity(accounts.len());
|
Vec::<(&Pubkey, &AccountSharedData)>::with_capacity(accounts.len());
|
||||||
let mut time_collecting_rent_us = 0;
|
let mut time_collecting_rent_us = 0;
|
||||||
let mut time_storing_accounts_us = 0;
|
let mut time_storing_accounts_us = 0;
|
||||||
let can_skip_rewrites = self.rc.accounts.accounts_db.skip_rewrites;
|
let can_skip_rewrites = false; // this will be goverened by a feature soon
|
||||||
let set_exempt_rent_epoch_max: bool = self
|
let set_exempt_rent_epoch_max: bool = self
|
||||||
.feature_set
|
.feature_set
|
||||||
.is_active(&solana_sdk::feature_set::set_exempt_rent_epoch_max::id());
|
.is_active(&solana_sdk::feature_set::set_exempt_rent_epoch_max::id());
|
||||||
|
|
|
@ -1026,7 +1026,6 @@ pub fn main() {
|
||||||
write_cache_limit_bytes: value_t!(matches, "accounts_db_cache_limit_mb", u64)
|
write_cache_limit_bytes: value_t!(matches, "accounts_db_cache_limit_mb", u64)
|
||||||
.ok()
|
.ok()
|
||||||
.map(|mb| mb * MB as u64),
|
.map(|mb| mb * MB as u64),
|
||||||
skip_rewrites: matches.is_present("accounts_db_skip_rewrites"),
|
|
||||||
ancient_append_vec_offset: value_t!(matches, "accounts_db_ancient_append_vecs", u64).ok(),
|
ancient_append_vec_offset: value_t!(matches, "accounts_db_ancient_append_vecs", u64).ok(),
|
||||||
exhaustively_verify_refcounts: matches.is_present("accounts_db_verify_refcounts"),
|
exhaustively_verify_refcounts: matches.is_present("accounts_db_verify_refcounts"),
|
||||||
..AccountsDbConfig::default()
|
..AccountsDbConfig::default()
|
||||||
|
|
Loading…
Reference in New Issue