[ckan-dev] sqlalchemy migrate, dependency issues.

William Waites ww at styx.org
Thu Jan 27 16:48:07 UTC 2011


* [2011-01-27 09:11:22 +0000] Seb Bacon <seb.bacon at gmail.com> écrit:

] > The issue I see with 1 is that if the application is started as an apache
] > wsgi script with multiple processes there could be a lot of pain (we do not
] > want to upgrade a database from 2 processes) and this would be hard to
] > debug.  We would need some kind of update db lock.
] 
] For (3), the update should indeed happen as part of our standard
] deploy process, which means it should be scripted.  Obviously a failed
] migration should cause a rollback to the previous version.

More complicated, but safer, is the strategy that we take when
upgrading HMG. There are two databases for each site and two copies
of the code base. An upgrade process looks like:

	- webapp is running out of db1, code1
	- make db1 read only (need a better way to do this, mostly done
          with the apache config restricting POST/PUT/DELETE)
	- dump db1, restore into db2
	- upgrade code2
	- upgrade db2
	- restart web app out of code2 pointing at db2
	- re-enable write operations

Everything short of the last step is easy to back out of.

-w
-- 
William Waites                <mailto:ww at styx.org>
http://eris.okfn.org/ww/         <sip:ww at styx.org>
F4B3 39BF E775 CF42 0BAB  3DF0 BE40 A6DF B06F FD45




More information about the ckan-dev mailing list