Open yahonda opened 1 year ago
Can you add tidb_skip_isolation_level_check
to the config https://docs.pingcap.com/tidb/stable/tidb-configuration-file? That way it could be disabled right away and there will be no need for this manual workaround. It's especially annoying in docker environment.
Feature Request
Is your feature request related to a problem? Please describe: One of the database migration tool, https://github.com/golang-migrate/migrate.
Describe the feature you'd like:
golang-migrate/migrate
sets isolation level toSERIALIZABLE
for MySQL database connections since https://github.com/golang-migrate/migrate/pull/656I recall that other migration tools like Ruby on Rails, Flyway, Prisma Migrate and elixir Ecto uses advisory locks not to run multiple migration at the same time. Now TiDB supports
get_lock()
function this issue has been resolved. https://github.com/pingcap/tidb/pull/33947 https://github.com/pingcap/tidb/issues/14994 on the other hand,golang-migrate/migrate
usesSERIALIZABLE
for the same purpose.Describe alternatives you've considered: Set
tidb_skip_isolation_level_check = 1
to workaround it.Teachability, Documentation, Adoption, Migration Strategy: Here is the steps to reproduce:
Install
golang-migrate
Create a new migration
Edit two migration files as follows
Startup TiUP Playground
Run the migration that raises
Error 8048: The isolation level 'SERIALIZABLE' is not supported. Set tidb_skip_isolation_level_check=1 to skip this error
Set
tidb_skip_isolation_level_check = 1
to workaround itRun the migration again with
tidb_skip_isolation_level_check = 1
2023/07/21 09:48:55 Start buffering 1/u create_users_table 2023/07/21 09:48:55 Read and execute 1/u create_users_table 2023/07/21 09:48:55 Finished 1/u create_users_table (read 4.380031ms, ran 201.558974ms) 2023/07/21 09:48:55 Finished after 211.977585ms 2023/07/21 09:48:55 Closing source and database %