Skip to content

Conversation

@shawnhathaway
Copy link
Contributor

@shawnhathaway shawnhathaway commented Aug 5, 2020

INSERT IGNORE has many sharp edges and does more than just ignore Duplicate Key Conflicts. It also swallows errors such as partitioning allocation and divide by zero errors and we should aim to not use this anywhere. See more here: https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#ignore-strict-comparison

Unfortunately MySQL does not have ON DUPLICATE KEY DO NOTHING, so instead we should use the ON DUPLICATE KEY UPDATE syntax and update something that is ideally part of the duplicate key conflict (in essence a no-op). However, that update should not be on the sharding key that we would want to use with Vitess, as this will cause issues with Vitess query validation.

After this change there is only one more location to change - ImmutableClusterMetadata, but cannot be changed in its current state as this table has no column that satisfies the constraints above. However as we read the row back in that case to validate, it is not as critical to solve in the short term.

@shawnhathaway shawnhathaway marked this pull request as ready for review August 5, 2020 21:17
@shawnhathaway shawnhathaway merged commit 91d8190 into temporalio:master Aug 9, 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