Hello koha-devel, Last week, I explained on #koha I wanted to propose a new database update mecanism [1]. Here is my proposal, I would like some feedbacks before coding... The idea is to simplify communication between developers on database update (data and/or structure). Here follow the main points of the mecanism: - isolated updates that can be executed only once - database self aware about its update level - notification in intranet screen that new updates are available A script update/updater.pl is run from the command line. The steps are: 1. list updates already executed (reading table "updates") 2. list available updates (numeric filenames in update/updates directory) 3. execute available updates that have not been executed yet These are the basics. updater.pl will first say if there are updates to execute. For example: $ updater.pl
2 updates are missing, choose an option:
1. list update details 2. execute all 3. execute one by one
[1] ?
updater.pl will write a log on each call. Update files will be Perl files in the update/updates dedicated directory, with numeric only filenames: $ ls -v1 updates
1 2 2.1 10
About numerotation of updates, on HEAD, updates are named with a single number (1, 2, 10...), on a branch like rel_2_2, updates are named with the last update number on HEAD point a number wich starts to 1 on rel_2_2. Just as an example, we could have: +------+ | HEAD | +------+ | | +---------+ | | rel_2_2 | 43 => | +---------+ 44 => | | +-----------+ | | <= 44.1 | | 45 => | | | | <= 44.2 46 => | | | | | | <= 44.3 | | 47 => | | | | | | | | 48 => | | <= 44.4 | | <= 44.5 49 => | | 50 => | | +---------+ 51 => | | rel_3_0 | 52 => | +---------+ 53 => | | +-----------+ 54 => | | <= 53.1 | | 55 => | | <= 53.2 | | | | | | <= 53.3 | Now, let's give me your feedback please :-) [1] http://tinyurl.com/ep6nx Cheers, -- Pierrick LE GALL INEO media system
Pierrick LE GALL <pierrick@koha-fr.org>
- isolated updates that can be executed only once - database self aware about its update level - notification in intranet screen that new updates are available
I think this is a good idea. Here are some more suggestions: 1. model the updates on sysV init scripts, so they can be started and stopped/applied and removed as needed by an upgrade; 2. the new updates notification should require deliberate action by the superlibrarian, else we may be violating user's privacy (also known as a "phone home" problem).
Update files will be Perl files in the update/updates dedicated directory, with numeric only filenames:
Can't they just start or end with a number, divided from the human-friendly name by a - or similar? It really is useful to have human-friendly names. Take a look at dpatch if you have a debian system nearby. http://alioth.debian.org/projects/dpatch/ - I'm sure there's been criticism of it, but I didn't locate it in a web search. Hope that helps, -- MJ Ray - personal email, see http://mjr.towers.org.uk/email.html Work: http://www.ttllp.co.uk/ irc.oftc.net/slef Jabber/SIP ask
On Wed, 22 Mar 2006 10:29:37 +0000 MJ Ray <mjr@phonecoop.coop> wrote:
Pierrick LE GALL <pierrick@koha-fr.org>
- isolated updates that can be executed only once - database self aware about its update level - notification in intranet screen that new updates are available
I think this is a good idea. Here are some more suggestions: 1. model the updates on sysV init scripts, so they can be started and stopped/applied and removed as needed by an upgrade;
It seems far more complicated than what I thought first. sysV init scripts are started at each server start/stop. Updates I propose are executed only once. If anything failed during updating, manual intervention will be required such as: - SQL> delete from update where update_id = 13; - manually edit "update 13" or ask developer to modify according to your problem - run once again the updater
2. the new updates notification should require deliberate action by the superlibrarian, else we may be violating user's privacy (also known as a "phone home" problem).
As I imagined it, update mechanism will be usefull among developers and after a minor upgrade (between 3.0.1 and 3.0.2 for example). In this condition, I really don't think developers and upgraders will feel their privacy has been violated by Koha update notifier, does it?
Update files will be Perl files in the update/updates dedicated directory, with numeric only filenames:
Can't they just start or end with a number, divided from the human-friendly name by a - or similar? It really is useful to have human-friendly names.
You mean examples like that? - updates/12-isbn_on_13_chars.update - updates/23-deletion_of_marc_tables.update No problem for me to allow any filename as long as it starts with an identification number.
Take a look at dpatch if you have a debian system nearby. http://alioth.debian.org/projects/dpatch/ - I'm sure there's been criticism of it, but I didn't locate it in a web search.
I've tried to find information but I didn't (dpatch website is very poor). Anyway, I'm not sure we have the same problem to solve than Debian packages. Maybe I missed something. Thanks for your feedback -- Pierrick LE GALL INEO media system
Pierrick LE GALL <pierrick@koha-fr.org>
MJ Ray <mjr@phonecoop.coop> wrote:
1. model the updates on sysV init scripts, so they can be started and stopped/applied and removed as needed by an upgrade;
It seems far more complicated than what I thought first. sysV init scripts are started at each server start/stop.
Not necessarily. It depends how you configure them.
Updates I propose are executed only once.
I agree, but I would like to both apply(start) and reverse(stop) them if possible, so sysadmins and beta testers can "back out" easily.
2. the new updates notification should require deliberate action by the superlibrarian, else we may be violating user's privacy (also known as a "phone home" problem).
As I imagined it, update mechanism will be usefull among developers and after a minor upgrade (between 3.0.1 and 3.0.2 for example). In this condition, I really don't think developers and upgraders will feel their privacy has been violated by Koha update notifier, does it?
I don't know. I think Koha should not "phone home" without asking, because that is against some network policies. Privacy violation by default would be bad publicity for the project.
- updates/12-isbn_on_13_chars.update - updates/23-deletion_of_marc_tables.update
No problem for me to allow any filename as long as it starts with an identification number.
Great!
Take a look at dpatch if you have a debian system nearby. http://alioth.debian.org/projects/dpatch/ - I'm sure there's been criticism of it, but I didn't locate it in a web search.
I've tried to find information but I didn't (dpatch website is very poor). Anyway, I'm not sure we have the same problem to solve than Debian packages. Maybe I missed something.
dpatch lets debian packagers apply and unapply updates to the software being packaged. It seemed a similar problem to applying updates to a database. I can't find a good website that explains dpatch, which is a pain. I'll ask around. Hope that helps, -- MJ Ray - personal email, see http://mjr.towers.org.uk/email.html Work: http://www.ttllp.co.uk/ irc.oftc.net/slef Jabber/SIP ask
participants (2)
-
MJ Ray -
Pierrick LE GALL