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

Historian: Improve cache hits for specific summary shas #14624

Merged
merged 3 commits into from
Mar 23, 2023

Conversation

znewton
Copy link
Contributor

@znewton znewton commented Mar 17, 2023

Description

Historian caches latest summary, but it doesn't check if a requested summary version is already cached as latest.

A bug in the R11s-driver was recently fixed in #14400 where the driver will request latest summary, then also request it again by its ID. This is fixed in the driver now, but will take some time to saturate clients using r11s-driver. We can lessen the impact of this bug on the server by causing that 2nd read to be a Cache Hit instead of a 100% miss.

Breaking Changes

None, but I removed a commented out section of code from #12036 and replaced it with a reference to an issue I opened to track it instead (#14623).

Reviewer Guidance

The goal here is to check if the requested summary sha is the same as the cached latest summary sha. However, we do not want to read the entire summary from cache into memory just to read its sha, in case it is not a cache hit. Instead, I added an additional cache key which will store specifically the cached latest summary's sha, which will improve efficiency of the sha equality check.

@znewton znewton requested a review from a team as a code owner March 17, 2023 19:19
@github-actions github-actions bot added area: server Server related issues (routerlicious) base: main PRs targeted against main branch labels Mar 17, 2023
@znewton znewton merged commit b449831 into microsoft:main Mar 23, 2023
@znewton znewton deleted the historian/improve-cache-hits branch March 23, 2023 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: server Server related issues (routerlicious) base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants