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

Add DB replica support #602

Merged
merged 5 commits into from
May 7, 2024
Merged

Add DB replica support #602

merged 5 commits into from
May 7, 2024

Conversation

enahum
Copy link
Contributor

@enahum enahum commented Apr 17, 2024

Summary

Adds Database read replica support when available

Ticket Link

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

@enahum enahum added the 2: Dev Review Requires review by a core committer label Apr 17, 2024
Copy link
Member

@jespino jespino left a comment

Choose a reason for hiding this comment

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

I like this one :)

Copy link
Member

@mgdelacroix mgdelacroix left a comment

Choose a reason for hiding this comment

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

LGTM! 👍

@mgdelacroix mgdelacroix added 4: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a core committer labels Apr 26, 2024
@enahum
Copy link
Contributor Author

enahum commented May 6, 2024

@jespino @mgdelacroix @wiggin77 are we ok merging this one ?

@@ -37,7 +37,7 @@ const (

func (s *SQLStore) runMSTeamUserIDDedup() error {
// get all users with duplicate msteamsuserid
rows, err := s.getQueryBuilder().Select(
rows, err := s.getMasterQueryBuilder().Select(
Copy link
Member

Choose a reason for hiding this comment

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

Why is master needed here for a SELECT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@wiggin77 I assumed is needed as this is a migration to avoid any sort of lag. I can change it to use the replica if you think is best

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll change it to use the replica and then merge.. if this causes issues we can always switch to use master again

Copy link
Member

@wiggin77 wiggin77 left a comment

Choose a reason for hiding this comment

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

This looks great! 👍 One item for consideration re using master for a select where replication lag would not be a factor.

@enahum enahum added the AutoMerge Used by Mattermod to merge PR automatically label May 6, 2024
@enahum
Copy link
Contributor Author

enahum commented May 7, 2024

/update-branch

@enahum enahum removed the AutoMerge Used by Mattermod to merge PR automatically label May 7, 2024
@enahum enahum merged commit 1f0d8bf into main May 7, 2024
10 of 11 checks passed
@enahum enahum deleted the replica branch May 7, 2024 02:30
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.

4 participants