You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems to me (after reading shmig source code), it's not safe to run multiple shmig up commands at the same time. It could happen in real life if one tries to do shmig up as part of application instance startup. With multiple instances of those running.
From a quick google, it looks like mysql and postgresql support "select for update"; sqlite3 does not. But I think it is fine to implement for whatever database you are using; I would certainly accept such a pull request.
I would like to add a test to shmig_test to verify bug before fixing it; I'll try and work one up this weekend.
It seems to me (after reading
shmig
source code), it's not safe to run multipleshmig up
commands at the same time. It could happen in real life if one tries to doshmig up
as part of application instance startup. With multiple instances of those running.This problem is discussed at stackexchange.com, with a potential solution using
SELECT FROM ... FOR UPDATE
:BEGIN
SELECT FROM $SCHEMA_TABLE FOR UPDATE WHERE version=$VERSION
ROLLBACK
if it fails and stop)INSERT INTO $SCHEMA_TABLE(version) VALUES ($VERSION)
COMMIT
@mbucc Would you be open to have this problem fixed in
shmig
? I could try to contribute the solution.The text was updated successfully, but these errors were encountered: