Handle removing slots during account scans (#17471)

This commit is contained in:
carllin
2021-06-14 21:04:01 -07:00
committed by GitHub
parent 471b34132e
commit ccc013e134
15 changed files with 934 additions and 319 deletions

View File

@ -260,7 +260,13 @@ fn bench_concurrent_read_write(bencher: &mut Bencher) {
fn bench_concurrent_scan_write(bencher: &mut Bencher) {
store_accounts_with_possible_contention("concurrent_scan_write", bencher, |accounts, _| loop {
test::black_box(
accounts.load_by_program(&Ancestors::default(), AccountSharedData::default().owner()),
accounts
.load_by_program(
&Ancestors::default(),
0,
AccountSharedData::default().owner(),
)
.unwrap(),
);
})
}
@ -389,9 +395,11 @@ fn bench_load_largest_accounts(b: &mut Bencher) {
accounts.store_slow_uncached(0, &pubkey, &account);
}
let ancestors = Ancestors::from(vec![0]);
let bank_id = 0;
b.iter(|| {
accounts.load_largest_accounts(
&ancestors,
bank_id,
20,
&HashSet::new(),
AccountAddressFilter::Exclude,