Skip to content

Conversation

@timvaillancourt
Copy link
Collaborator

@timvaillancourt timvaillancourt commented Aug 13, 2022

Description

This PR moves the applier .ReadMigrationRangeValues() func to use a single transaction for both the min and max queries

Gathering these values in the same transaction is more accurate than the current approach where 2 x different auto-commit transactions grab these values

Lastly, the min/max funcs were made "private" because they're only called by .ReadMigrationRangeValues()

In case this PR introduced Go code changes:

  • contributed code is using same conventions as original code
  • script/cibuild returns with no formatting errors, build errors or unit test errors.

@timvaillancourt timvaillancourt requested review from a user and rashiq August 13, 2022 00:36
@timvaillancourt timvaillancourt marked this pull request as ready for review August 13, 2022 00:58
@timvaillancourt timvaillancourt added this to the v1.1.6 milestone Aug 18, 2022
Copy link
Contributor

@shlomi-noach shlomi-noach left a comment

Choose a reason for hiding this comment

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

This change is fine. Ultimately it does not matter that much: we take note of the binlog position before we evaluate the min/max range values. That means however we read the min/max values, any changes that happen in between -- we will address those changes as we iterate the binary logs; the changes will be covered by the binlog stream that we process.

@timvaillancourt
Copy link
Collaborator Author

This change is fine.

Thanks @shlomi-noach! Yeah I think so, I'm glad this didn't break any assumptions I didn't know about 👍

we will address those changes as we iterate the binary logs; the changes will be covered by the binlog stream that we process.

Agreed, I think this is more of a cosmetic change that won't actually affect the correctness of the end-result

@timvaillancourt timvaillancourt merged commit 3c946e9 into github:master Sep 6, 2022
@timvaillancourt timvaillancourt deleted the ReadMigrationValues-transaction branch September 6, 2022 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants