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

MM-60548: Use DB instance endpoints directly #800

Merged
merged 2 commits into from
Sep 18, 2024
Merged

Conversation

agnivade
Copy link
Member

AWS enforces a limit of 5 custom endpoints per cluster: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Aurora.Endpoints.Custom.html

I am not sure how we didn't run into this in our
previous ceiling tests, but anyways I got blocked
by this randomly.

Turns out that we don't need custom endpoints in the first place, because we were anyways mapping 1:1 from endpoint to instance. So we can directly use the
instance endpoint.

This also allows us to use the writer field in the instance struct to let us cleanly identify the writer rather than looking for an instance prefix.

https://mattermost.atlassian.net/browse/MM-60548

AWS enforces a limit of 5 custom endpoints per cluster:
https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Aurora.Endpoints.Custom.html

I am not sure how we didn't run into this in our
previous ceiling tests, but anyways I got blocked
by this randomly.

Turns out that we don't need custom endpoints in the
first place, because we were anyways mapping 1:1 from
endpoint to instance. So we can directly use the
instance endpoint.

This also allows us to use the writer field in the
instance struct to let us cleanly identify the writer
rather than looking for an instance prefix.

https://mattermost.atlassian.net/browse/MM-60548
@agnivade agnivade added the 2: Dev Review Requires review by a core committer label Sep 16, 2024
Copy link
Member

@agarciamontoro agarciamontoro left a comment

Choose a reason for hiding this comment

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

Oh, this is way nicer! Do we know why we were using custom endpoints in the first place?

@agnivade
Copy link
Member Author

Yeah, I've been trying to remember myself. I think it was an oversight, but I'll let Claudio chime in if there was a specific reason.

@streamer45
Copy link
Contributor

Can't recall if there was a specific reason, although, as mentioned in https://hub.mattermost.com/private-core/pl/7h18pessxidwfk6y7ocjz5cqxo, I am not sure what would happen with regards to failover (e.g. writer instance going down).

At a high level, I don't think these changes would be any more problematic than the former approach but it's something to keep in mind as I remember back in the days that in case of a failure Aurora would run some failover logic that would mess up the deployment.

@agnivade
Copy link
Member Author

The current approach anyways doesn't do anything about failover because the endpoint is mapped directly to a single instance. Failover only comes into play when you use cluster endpoints, which we are not using here. But agree that these changes isn't any worse than the earlier approach. Although, I do like the benefit of using the writer field rather than relying of rd/wr prefixes.

@agnivade agnivade added 4: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a core committer labels Sep 18, 2024
@agnivade agnivade merged commit fd7cc50 into master Sep 18, 2024
1 check passed
@agnivade agnivade deleted the removeCustomEndpoint branch September 18, 2024 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4: Reviews Complete All reviewers have approved the pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants