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

Create SchemaVersion Tables with Partition Column #602

Merged
merged 1 commit into from
Jul 24, 2020
Merged

Create SchemaVersion Tables with Partition Column #602

merged 1 commit into from
Jul 24, 2020

Conversation

shawnhathaway
Copy link
Contributor

@shawnhathaway shawnhathaway commented Jul 23, 2020

What changed?

  • Add version_partition column to MySQL/Postgres schema_version and schema_update_history tables.
  • Convert MySQL REPLACE INTO usage to INSERT ON DUPLICATE KEY UPDATE for the writeSchemaVersionQuery.

Why?
We will need to change schema creation behavior in the future to support Vitess as we cannot perform schema structure CRUD operations over the mysql interface. However this ensures we have the correct key structure for the future.

How did you test it?
Existing CLI Schema Update Unit Tests

@shawnhathaway shawnhathaway requested review from samarabbas, alexshtin and a team July 23, 2020 22:54
Copy link
Member

@alexshtin alexshtin left a comment

Choose a reason for hiding this comment

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

I don't quite understand the purpose but from code prospective it looks ok.

@shawnhathaway
Copy link
Contributor Author

shawnhathaway commented Jul 24, 2020

I don't quite understand the purpose but from code prospective it looks ok.

Clarified in person :) This is necessary to keep all records pinned to a single shard in case the tables need to be present in a sharded Vitess keyspace (they do currently).

@shawnhathaway shawnhathaway merged commit 9865b53 into temporalio:master Jul 24, 2020
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