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

Do not load entire leaf just to get anchor view #2215

Merged
merged 1 commit into from
Oct 24, 2024
Merged

Conversation

jbearer
Copy link
Member

@jbearer jbearer commented Oct 24, 2024

We have seen heavy load on water DBs due to loading the anchor leaf in the proposal fetching task. This is because the leaves are very large because we store the payload in the leaf, which we should not do. That is a separate bug with a separate fix. This fix addresses the fact that we shouldn't need to load the leaf at all in this task, since we only care about the view number.

This PR:

  • Adds a dedicated load_anchor_view persistence function
  • Implements this function efficiently for SQL storage

This PR does not:

  • Implement load_anchor_view efficiently for FS storage, since to get the view number we'd have to load the whole file and deserialize the leaf anyways, because view is not stored separately. Thus, it is easier to just call load_anchor_leaf and pull out the view number

Copy link
Contributor

@tbro tbro left a comment

Choose a reason for hiding this comment

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

LGTM

@jbearer jbearer merged commit 3d46e44 into main Oct 24, 2024
13 checks passed
@jbearer jbearer deleted the jb/load_anchor_view branch October 24, 2024 22:01
github-actions bot pushed a commit that referenced this pull request Oct 24, 2024
Copy link
Contributor

Successfully created backport PR for release-rogue:

jbearer added a commit that referenced this pull request Oct 24, 2024
…iew (#2216)

Do not load entire leaf just to get anchor view (#2215)

(cherry picked from commit 3d46e44)

Co-authored-by: Jeb Bearer <jeb.bearer@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants