Do not load entire leaf just to get anchor view #2215
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
load_anchor_view
persistence functionThis PR does not:
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 callload_anchor_leaf
and pull out the view number