-
Notifications
You must be signed in to change notification settings - Fork 271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A benchmark suite for the getAccountInfo
RPC call
#3959
A benchmark suite for the getAccountInfo
RPC call
#3959
Conversation
let end: u64 = max_created.load(Ordering::Relaxed); | ||
let seed_range = start..end; | ||
if seed_range.is_empty() { | ||
info!("get_account_info: No accounts have yet been created; skipping"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See note here: #3960.
let seed = thread_rng().gen_range(seed_range).to_string(); | ||
let account_pubkey = | ||
Pubkey::create_with_seed(&base_keypair_pubkey, &seed, &program_id).unwrap(); | ||
match client.get_account(&account_pubkey) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some percentage of these loads fail with:
[2024-12-05T22:23:08.309451301Z INFO solana_accounts_cluster_bench] get_account_info error: Error { request: None, kind: RpcError(ForUser("AccountNotFound: pubkey=Bp88sz54nzCwcxv8S7K6s6Yw5MX4H2FVwVm5sufvBDPa")) }
I don't know if executor.pushTransactions()
is sufficient to presume that the accounts have actually been created.
https://github.com/anza-xyz/agave/blob/master/accounts-cluster-bench/src/main.rs#L643
Is that what's going on here? Is it some sort of race, where I try to get the account before the transaction has committed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, when push_transactions() returns the txs have been queued but not
guaranteed to have been processed and included in a block.
The code that create accounts is very involved, not sure it's easy to change
to guarantee this.
info!("get_account_info: No accounts have yet been created; skipping"); | ||
continue; | ||
} | ||
let seed = thread_rng().gen_range(seed_range).to_string(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Samples randomly from the range of seeds belonging to open accounts.
automerge label removed due to a CI failure |
3104efa
to
0b0d539
Compare
accounts-cluster-bench/src/main.rs
Outdated
@@ -683,6 +720,8 @@ fn run_accounts_bench( | |||
let _ = executor.drain_cleared(); | |||
} | |||
|
|||
start_bench_tx.send(()).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
won't this only unblock one of the bench threads?
For this kind of stuff, I think
https://doc.rust-lang.org/stable/std/sync/struct.Barrier.html would be more idiomatic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, looks like stacking got me already 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
won't this only unblock one of the bench threads?
Dude, I don't know how computers work.
ty for the pointer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nickfrosty, this is – in my opinion – a perfect example of what we were talking about earlier today. In this particular instance I was on the ‘don't know what I don't know‘ side of the house. I needed a guide on synchronization primitives. I spent a ton of time with the Rust API docs, but they didn't lead me to the right solution. Furthermore, as soon as Alessandro gave me the pointer to Barrier
, I no longer had any use for the web-based API docs; I found all the answers I needed in the Rust LSP / the code itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bench here looks good. For the channel unblock thing, see the other PR.
0b0d539
to
0917e14
Compare
Updated to use |
0917e14
to
93fae78
Compare
Actually, dropped the synchronization in this PR in favour of #3960. Must land that first before this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r+ #3960 landing first
735584b
to
c0ede40
Compare
c0ede40
to
42da0f9
Compare
Summary of Changes
Related: #3242.