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

speed up gtid process for mysql #738

Merged
merged 5 commits into from
Nov 24, 2022
Merged

Conversation

GMHDBJD
Copy link
Contributor

@GMHDBJD GMHDBJD commented Nov 17, 2022

  • add InsertInterval for mysql gtidset

mysql/gtid.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@lance6716 lance6716 left a comment

Choose a reason for hiding this comment

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

rest lgtm

}
i++
if count > 0 {
for i != total {
Copy link
Collaborator

Choose a reason for hiding this comment

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

seems we can use a copy to move multiple elements with count offset, and truncate the last count elements

	if count > 0 {
		i++
		copy((*s)[i:], (*s)[i+count:])
		*s = (*s)[:total-count]
	}

@@ -439,6 +484,17 @@ func (s *MysqlGTIDSet) Update(GTIDStr string) error {
return nil
}

func (s *MysqlGTIDSet) AddGTID(uuid uuid.UUID, gno int64) error {
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove returned error?

@lance6716 lance6716 merged commit bc5406a into go-mysql-org:master Nov 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants