Skip to content
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

accounts-db: disable intrabatch account locks #4253

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

2501babe
Copy link
Member

@2501babe 2501babe commented Jan 3, 2025

aka "simd83 account locking"

TODO confirm it behaves right with the feature on, dedupe transactions via messagehash, write tests

Problem

Summary of Changes

Fixes #

@2501babe 2501babe force-pushed the 20250103_simd83locking branch from 3e016b3 to f748a5f Compare January 3, 2025 10:46
@2501babe 2501babe self-assigned this Jan 3, 2025
@2501babe 2501babe force-pushed the 20250103_simd83locking branch 2 times, most recently from 315ef3d to 546adb0 Compare January 6, 2025 10:41
@2501babe 2501babe force-pushed the 20250103_simd83locking branch from 546adb0 to 91fd4f2 Compare January 6, 2025 10:43
@2501babe 2501babe force-pushed the 20250103_simd83locking branch from 2fb8527 to 11d1dcb Compare January 7, 2025 11:23
@2501babe 2501babe changed the title accounts-db: only lock accounts across threads accounts-db: disable intrabatch account locks Jan 7, 2025
Err(err) => Err(err),
})
.collect()
if disable_intrabatch_account_locks {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: This feature gate name is a little confusing as it's used here.
When disable_intrabatch_account_locks is true, this means account locks within a batch shouldn't be allowed. But it's used the other way around here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the idea isnt that intrabatch locks shouldnt be allowed, but that the concept of intrabatch locking will cease to exist. i will think of a clearer name tho ty

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe relax_intrabatch_account_locks

// HANA TODO the vec allocation here is unfortunate but hard to avoid
// we cannot do this in one closure because of borrow rules
// play around with alternate strategies, according to benches this may be up to
// 50% slower for small batches and few locks, but for large batches and many locks
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bench using jemalloc? i'd think it would do a reasonable job of just keeping the mem in thread-local cache for re-use

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants