Hi all,

In my scenario, DB migrations (via alembic) will be run as part of the app 
deployment and multiple app deployments will happen near simultaneously 
(multiple EC2 instances talking to the same MySQL DB). Let's, for 
simplicity's sake assume two instances:

Instance #1: Alembic sees alembic_version table and finds that we do need 
the migrations to happen, and starts the migration. 

Instance #2: Alembic sees alembic_version table and finds that we do need 
the migrations to happen, and starts the migration.  This doesn't obviously 
happen since MySQL will lock the table during the migration.

Now, let's say instance #1 finishes the migration first and updates the 
alembic_version table. Then, the migration triggered by instance #2 starts 
to run, and errors out because the schema changes are already in place. 

Is this what will happen or does alembic get a read/write lock on 
alembic_version table for the entire migration? (And hence instance #2 
never will need to run the migration since when it reads alembic_version, 
the DB already has the migrated schema).

Thanks for your insights.

Best Wishes,
Amit.





-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy-alembic" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy-alembic+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to