Merge lp:~knielsen/ourdelta/bug_484127_484120_2 into lp:ourdelta

Proposed by Kristian Nielsen
Status: Merged
Merged at revision: not available
Proposed branch: lp:~knielsen/ourdelta/bug_484127_484120_2
Merge into: lp:ourdelta
Diff against target: 147 lines (+20/-30)
3 files modified
bakery/debian-5.1/additions/debian-start (+4/-0)
bakery/debian-5.1/dist/Debian/mariadb-server-5.1.postinst (+8/-15)
bakery/debian-5.1/dist/Ubuntu/mariadb-server-5.1.postinst (+8/-15)
To merge this branch: bzr merge lp:~knielsen/ourdelta/bug_484127_484120_2
Reviewer Review Type Date Requested Status
Arjen Lentz Approve
Review via email: mp+16212@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Kristian Nielsen (knielsen) wrote :

This fixes Bug484120 and 484127.

In particular it fixes a problem on Hardy where upgrading from mysql 5.0 would leave
the database not upgraded to 5.1 format until next server restart.

Revision history for this message
Arjen Lentz (arjen-lentz) wrote :

Ok.

review: Approve
Revision history for this message
Kristian Nielsen (knielsen) wrote :

Hi Arjen,

This is what I did so far:

1. Update tarbake51.sh

2. Update autobake51-bintar.sh

3. Update autobake51-deb.sh (and files in bakery/debian-5.1).

I pushed this to

    lp:~knielsen/ourdelta/ourdelta-mariadb-5.1.41-knielsen

Check commit comments for details.

I also merged this with my bugfixes which are not yet merged into lp:ourdelta,
pushed here:

    lp:~maria-captains/ourdelta/ourdelta-montyprogram-fixes

I am now running Buildbot tests on this. I still need to check that upgrade
from MariadB-5.1.39 to MariaDB-5.1.41 on Debian/Ubuntu go smoothly despite the
change ourdelta->mariadb (I hope to automate this in Buildbot, else will check
manually).

For Centos, the "OurDelta" is part of the package name, so the upgrade issue
may be harder? This is beyond my .rpm skills, I assume some conflict/replaces
headers could be added?. Or maybe we can just have users uninstall 5.1.39
manually (it's a beta after all and I don't know if there are any users out
there?).

Arjen Lentz <email address hidden> writes:

> Subject: Re: [Merge] lp:~knielsen/ourdelta/bug_484127_484120_2 into lp:ourdelta
> Review: Approve
> Ok.
> --
> https://code.launchpad.net/~knielsen/ourdelta/bug_484127_484120_2/+merge/16212
> You are the owner of lp:~knielsen/ourdelta/bug_484127_484120_2.

Remember that this needs to be merged before the final release build! (A merge
is available in lp:~maria-captains/ourdelta/ourdelta-montyprogram-fixes, but
it automerges cleanly in any case).

 - Kristian.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bakery/debian-5.1/additions/debian-start'
2--- bakery/debian-5.1/additions/debian-start 2008-10-20 22:54:11 +0000
3+++ bakery/debian-5.1/additions/debian-start 2009-12-15 18:09:16 +0000
4@@ -22,6 +22,10 @@
5 # "check_for_crashed_tables" out.
6 # (There may be no output to stdout inside the background process!)
7 echo "Checking for corrupt, not cleanly closed and upgrade needing tables."
8+
9+# Need to ignore SIGHUP, as otherwise a SIGHUP can sometimes abort the upgrade
10+# process in the middle.
11+trap "" SIGHUP
12 (
13 upgrade_system_tables_if_necessary;
14 check_root_accounts;
15
16=== modified file 'bakery/debian-5.1/dist/Debian/mariadb-server-5.1.postinst'
17--- bakery/debian-5.1/dist/Debian/mariadb-server-5.1.postinst 2009-11-15 07:26:12 +0000
18+++ bakery/debian-5.1/dist/Debian/mariadb-server-5.1.postinst 2009-12-15 18:09:16 +0000
19@@ -9,6 +9,9 @@
20
21 # This command can be used as pipe to syslog. With "-s" it also logs to stderr.
22 ERR_LOGGER="logger -p daemon.err -t mysqld_safe -i"
23+# This will make an error in a logged command immediately apparent by aborting
24+# the install, rather than failing silently and leaving a broken install.
25+set -o pipefail
26
27 invoke() {
28 if [ -x /usr/sbin/invoke-rc.d ]; then
29@@ -18,7 +21,7 @@
30 fi
31 }
32
33-MYSQL_BOOTSTRAP="/usr/sbin/mysqld --bootstrap --user=mysql --skip-grant-tables"
34+MYSQL_BOOTSTRAP="/usr/sbin/mysqld --bootstrap --user=mysql --skip-grant-tables --innodb=OFF --pbxt=OFF --default-storage-engine=myisam"
35
36 test_mysql_access() {
37 mysql --no-defaults -u root -h localhost </dev/null >/dev/null 2>&1
38@@ -135,13 +138,13 @@
39 touch $mysql_statedir/debian-5.1.flag
40
41 # initiate databases. Output is not allowed by debconf :-(
42+ # This will fail if we are upgrading an existing database; in this case
43+ # mysql_upgrade, called from the /etc/init.d/mysql start script, will
44+ # handle things.
45 # Debian: beware of the bashisms...
46 # Debian: can safely run on upgrades with existing databases
47 set +e
48 /bin/bash /usr/bin/mysql_install_db --rpm --user=mysql 2>&1 | $ERR_LOGGER
49- if [ "$?" != "0" ]; then
50- echo "ATTENTION: An error has occured. More info is in the syslog!"
51- fi
52 set -e
53
54 ## On every reconfiguration the maintenance user is recreated.
55@@ -203,15 +206,6 @@
56 " Show_view_priv='Y', Create_routine_priv='Y', Alter_routine_priv='Y', "\
57 " Create_user_priv='Y', Event_priv='Y', Trigger_priv='Y',"\
58 " ssl_cipher='', x509_issuer='', x509_subject='';"`;
59- fix_privs=`/bin/echo -e \
60- "USE mysql;\n" \
61- "ALTER TABLE user ADD column Create_view_priv enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N'; " \
62- "ALTER TABLE user ADD column Show_view_priv enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N'; " \
63- "ALTER TABLE user ADD column Create_routine_priv enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N'; " \
64- "ALTER TABLE user ADD column Alter_routine_priv enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N'; " \
65- "ALTER TABLE user ADD column Create_user_priv enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N'; " \
66- "ALTER TABLE user ADD column Event_priv enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N'; " \
67- "ALTER TABLE user ADD column Trigger_priv enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N'; " `
68 # Engines supported by etch should be installed per default. The query sequence is supposed
69 # to be aborted if the CREATE TABLE fails due to an already existent table in which case the
70 # admin might already have chosen to remove one or more plugins. Newlines are necessary.
71@@ -229,9 +223,8 @@
72 password_error="yes"
73 fi
74
75- echo "$fix_privs" | $MYSQL_BOOTSTRAP 2>&1 | $ERR_LOGGER
76+ set +e
77 echo "$replace_query" | $MYSQL_BOOTSTRAP 2>&1 | $ERR_LOGGER
78- set +e
79 echo "$install_plugins" | $MYSQL_BOOTSTRAP 2>&1 | $ERR_LOGGER
80 set -e
81 ;;
82
83=== modified file 'bakery/debian-5.1/dist/Ubuntu/mariadb-server-5.1.postinst'
84--- bakery/debian-5.1/dist/Ubuntu/mariadb-server-5.1.postinst 2009-10-23 10:05:34 +0000
85+++ bakery/debian-5.1/dist/Ubuntu/mariadb-server-5.1.postinst 2009-12-15 18:09:16 +0000
86@@ -9,6 +9,9 @@
87
88 # This command can be used as pipe to syslog. With "-s" it also logs to stderr.
89 ERR_LOGGER="logger -p daemon.err -t mysqld_safe -i"
90+# This will make an error in a logged command immediately apparent by aborting
91+# the install, rather than failing silently and leaving a broken install.
92+set -o pipefail
93
94 invoke() {
95 if [ -x /usr/sbin/invoke-rc.d ]; then
96@@ -18,7 +21,7 @@
97 fi
98 }
99
100-MYSQL_BOOTSTRAP="/usr/sbin/mysqld --bootstrap --user=mysql --skip-grant-tables"
101+MYSQL_BOOTSTRAP="/usr/sbin/mysqld --bootstrap --user=mysql --skip-grant-tables --innodb=OFF --pbxt=OFF --default-storage-engine=myisam"
102
103 test_mysql_access() {
104 mysql --no-defaults -u root -h localhost </dev/null >/dev/null 2>&1
105@@ -136,13 +139,13 @@
106 touch $mysql_statedir/debian-5.1.flag
107
108 # initiate databases. Output is not allowed by debconf :-(
109+ # This will fail if we are upgrading an existing database; in this case
110+ # mysql_upgrade, called from the /etc/init.d/mysql start script, will
111+ # handle things.
112 # Debian: beware of the bashisms...
113 # Debian: can safely run on upgrades with existing databases
114 set +e
115 /bin/bash /usr/bin/mysql_install_db --rpm --user=mysql 2>&1 | $ERR_LOGGER
116- if [ "$?" != "0" ]; then
117- echo "ATTENTION: An error has occured. More info is in the syslog!"
118- fi
119 set -e
120
121 ## On every reconfiguration the maintenance user is recreated.
122@@ -204,15 +207,6 @@
123 " Show_view_priv='Y', Create_routine_priv='Y', Alter_routine_priv='Y', "\
124 " Create_user_priv='Y', Event_priv='Y', Trigger_priv='Y',"\
125 " ssl_cipher='', x509_issuer='', x509_subject='';"`;
126- fix_privs=`/bin/echo -e \
127- "USE mysql;\n" \
128- "ALTER TABLE user ADD column Create_view_priv enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N'; " \
129- "ALTER TABLE user ADD column Show_view_priv enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N'; " \
130- "ALTER TABLE user ADD column Create_routine_priv enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N'; " \
131- "ALTER TABLE user ADD column Alter_routine_priv enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N'; " \
132- "ALTER TABLE user ADD column Create_user_priv enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N'; " \
133- "ALTER TABLE user ADD column Event_priv enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N'; " \
134- "ALTER TABLE user ADD column Trigger_priv enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N'; " `
135 # Engines supported by etch should be installed per default. The query sequence is supposed
136 # to be aborted if the CREATE TABLE fails due to an already existent table in which case the
137 # admin might already have chosen to remove one or more plugins. Newlines are necessary.
138@@ -230,9 +224,8 @@
139 password_error="yes"
140 fi
141
142- echo "$fix_privs" | $MYSQL_BOOTSTRAP 2>&1 | $ERR_LOGGER
143+ set +e
144 echo "$replace_query" | $MYSQL_BOOTSTRAP 2>&1 | $ERR_LOGGER
145- set +e
146 echo "$install_plugins" | $MYSQL_BOOTSTRAP 2>&1 | $ERR_LOGGER
147 set -e
148

Subscribers

People subscribed via source and target branches

to all changes: