Skip to content

UPDATE on migration's unique key column data loss: fixing#520

Merged
shlomi-noach merged 7 commits intomasterfrom
update-migration-unique-key
Nov 30, 2017
Merged

UPDATE on migration's unique key column data loss: fixing#520
shlomi-noach merged 7 commits intomasterfrom
update-migration-unique-key

Conversation

@shlomi-noach
Copy link
Copy Markdown
Contributor

Fixes #519

This work in progress PR is to tackle #519, where an update to the migration's iterating unique key column can result with data loss.

We will either:

  • Solve it completely, or
  • Recognize the problem in runtime and throw an error, failing the migration, or
  • Update the documentation to note such an update is unsupported.

We'll see how goes.

Initial commit: a test that reproduces the data loss.

@shlomi-noach
Copy link
Copy Markdown
Contributor Author

At this stage gh-ost will fail a migration when an UPDATE is made to values of the migration key.
This is not to be merged yet. I want to see if gh-ost can further resolve the issue gracefully.

@shlomi-noach
Copy link
Copy Markdown
Contributor Author

3898d49 turns an UPDATE which modifies the migration key into DELETE+INSERT (to clarify, only when columns of migration key are actually changed).

Sending to testing.

@shlomi-noach shlomi-noach temporarily deployed to production/mysql_role=ghost_testing November 20, 2017 06:20 Inactive
@shlomi-noach shlomi-noach temporarily deployed to production/mysql_role=ghost_testing November 20, 2017 08:27 Inactive
@shlomi-noach shlomi-noach changed the title WIP: Update to migration's unique key column data loss: fixing Update to migration's unique key column data loss: fixing Nov 30, 2017
@shlomi-noach shlomi-noach changed the title Update to migration's unique key column data loss: fixing UPDATE on migration's unique key column data loss: fixing Nov 30, 2017
@shlomi-noach
Copy link
Copy Markdown
Contributor Author

Tests are good in production.

@shlomi-noach shlomi-noach merged commit 5d45b53 into master Nov 30, 2017
@shlomi-noach shlomi-noach deleted the update-migration-unique-key branch November 30, 2017 08:39
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.

1 participant