Package doesn't work anymore if network failed during migration
dearlordylord opened this issue · 1 comments
dearlordylord commented
Reason is you set locked state in db and unset it at the end. If migration didn't end due to network fail, package will continue to be in locked state infinitely unless you unlock with Migrations._collection.update({_id: 'control'}, {$set: {locked: false}})
manually but even then your migration is still 'in the middle', meaning part of data is migrated and another part is not. It is ok if migration script is idempotent though.
zol commented
This case should be rare enough that manual intervention is ok, and in fact, a good thing. Otherwise you could easily miss the fact that your migration only ran part of the way. Using a non-transactional database like Mongo, idempotent migrations are a must.