-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Replaces ReadAccountMapEntry in read_index_for_accessor_or_load_slow() #35220
Replaces ReadAccountMapEntry in read_index_for_accessor_or_load_slow() #35220
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #35220 +/- ##
=========================================
- Coverage 81.6% 81.6% -0.1%
=========================================
Files 833 833
Lines 224765 224776 +11
=========================================
- Hits 183480 183476 -4
- Misses 41285 41300 +15 |
2e99fc1
to
f57b729
Compare
// `lock` is dropped here rather pretty quickly with clone_in_lock = false, | ||
// so the entry could be raced for mutation by other subsystems, | ||
// before we actually provision an account data for caller's use from now on. | ||
// This is traded for less contention and resultant performance, introducing fair amount of | ||
// delicate handling in retry_to_get_account_accessor() below ;) | ||
// you're warned! |
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.
There's a lot of comments that I removed in this function. I feel like some is out-of-date and is fine to remove, but some may still be useful... Any thoughts on what should stay and how/where to put it?
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.
it is hard to fit them in. They are outdated in a few ways. clone_in_lock
is straightforward to understand. I'm ok with removing the comments. The code is simpler.
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.
On code wise, the change in the PR looks good to me. About code comments, it looks like there may be some delicate interaction with "retry". I will defer to jeff to decide how to deal with these comments.
f57b729
to
ddce2f2
Compare
I rebased and force-pushed this branch to pull in #35307. |
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.
lgtm
Problem
See #34786 for background.
We want to limit the use of
ReadAccountMapEntry
, from AccountsIndex, everywhere. Ultimately removing it once there are no more uses.When reading the index for an account accessor, we currently use
ReadAccountMapEntry
viaAccountsIndex::get()
. But we can do it other ways withoutReadAccountMapEntry
.Summary of Changes
Adds
get_with_and_then()
and uses it inread_index_for_accessor_or_load_slow()