-
Notifications
You must be signed in to change notification settings - Fork 456
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
safekeeper: use arc for global timelines and config #10051
safekeeper: use arc for global timelines and config #10051
Conversation
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, cc @arssher just to make sure
7051 tests run: 6726 passed, 0 failed, 325 skipped (full report)Flaky tests (2)Postgres 14
Code coverage* (full report)
* collected from Rust tests only The comment gets automatically updated with the latest test results
c0a55ee at 2024-12-09T17:14:00.178Z :recycle: |
status: blocked on #10059. @oldmanfleming after it merged, could you merge main? (better not a rebase as we merge with squash anyways) |
@oldmanfleming thanks for merging latest main. I will give some time for @arssher and @petuhovskiy to give it a look as they are more familiar with the code than I am, but it looks good from my point of view. Definitely an improvement. |
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.
Very cool, thank you @oldmanfleming!
@arpad-m can you run the CI and merge this?
The CI has passed already 🎉 |
Merged, thanks again. |
@arpad-m No problemo 😄 |
Hello! I was interested in potentially making some contributions to Neon and looking through the issue backlog I found 8200 which seemed like a good first issue to attempt to tackle. I see it was assigned a while ago so apologies if I'm stepping on any toes with this PR. I also apologize for the size of this PR. I'm not sure if there is a simple way to reduce it given the footprint of the components being changed.
Problem
This PR is attempting to address part of the problem outlined in issue 8200. Namely to remove global static usage of timeline state in favour of
Arc<GlobalTimelines>
and to replace wasteful clones ofSafeKeeperConf
withArc<SafeKeeperConf>
. I did not opt to tackleRemoteStorage
in this PR to minimize the amount of changes as this PR is already quite large. I also did not opt to introduce anSafekeeperApp
wrapper struct to similarly minimize changes but I can tackle either or both of these omissions in this PR if folks would like.Summary of changes
GlobalTimelines
in favour ofArc<GlobalTimelines>
SafeKeeperConf
inArc
to avoid wasteful clones of the underlying structSome additional thoughts
SafeKeeperConf
inGlobalTimelines
and then expose it through a publicget_global_config
function which requires locking. This seems needlessly wasteful and based on observed usage we could remove this public accessor and force consumers to acquireSafeKeeperConf
through the new Arc reference.