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

vreplication: code improvement #4946

Merged
merged 3 commits into from
Jun 26, 2019
Merged

Conversation

sougou
Copy link
Contributor

@sougou sougou commented Jun 21, 2019

Returning queries to execute is a bad pattern, and bloats code.
This new pattern delegates the generation and execution to a
single function. Much cleaner code.

Signed-off-by: Sugu Sougoumarane ssougou@gmail.com

Returning queries to execute is a bad pattern, and bloats code.
This new pattern delegates the generation and execution to a
single function. Much cleaner code.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Push down the retriable exec into vdbClient so vcopier can also use it.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
@sougou sougou requested review from deepthi and rafael June 24, 2019 18:26
}
continue
}
if _, err := vc.DBClient.ExecuteFetch(q, 10000); err != nil {
return err
result, err := vc.DBClient.ExecuteFetch(q, 100000)
Copy link
Member

Choose a reason for hiding this comment

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

Since this is using the default maxRows, can you replace it with a call to Execute?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was set to 100K rows based on the max packet size of 30K. There's actually no need to set a limit on number of rows because it can't exceed the max packet size. However, since max packet size is configurable, I think I should set it to max packet size itself (assuming worst case of 1 byte per row).

Copy link
Member

Choose a reason for hiding this comment

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

Ah, this is being passed down to DBClient. That sounds like a good idea.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As for maxrows in the original ExecuteFetch, the signature cannot be changed until old binlog player is deprecated.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
@deepthi deepthi merged commit 84a36ab into vitessio:master Jun 26, 2019
@sougou sougou deleted the ss-vrepl branch June 27, 2019 05:47
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