-
Notifications
You must be signed in to change notification settings - Fork 649
Convert more endpoints to the read-only follower database #3118
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
Convert more endpoints to the read-only follower database #3118
Conversation
do we have some docs somewhere that explain when to use which DB? |
I've pushed another commit to this PR, converting even more The reason is, we can't catch these bugs in CI. When running tests, everything happens inside a single transaction that is eventually discarded, so all endpoints accessed in a single test have to go through the same connection. It's possible we could switch the 1 connection between read-only and read-write during an individual test, but we don't have the test infrastructure in place for that. The staging environment is set up such that it defines a
The general rule of thumb I have is that anything I think we should also avoid converting endpoints related to authentication. While there should only ever be a slight delay on the follower database, we don't want a user who just logged in to have issues accessing |
I've tested all these endpoints on staging, and didn't see any issues. It actually took me a little while to figure out the API of the 2 deprecated routes. I believe we can remove these routes, as I see no activity on them in the logs from the last month, but for now they are converted to the follower, for whatever that is worth. |
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 👍
the only thing I'm a little bit worried about is the potential loss of consistency from using the slightly delayed read replica of the database. this could potentially mean that if the frontend modified something and then queried for the same resource it could still see the old data. I don't know how long that delay is in practice though.
(feel free to r=me)
@bors r=Turbo87 (Merging now, going to deploy this separately from the current deploy.) |
📌 Commit aea4457 has been approved by |
☀️ Test successful - checks-actions |
r? @pietroalbini