Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.5 - Add --skip-log-bin for bootstrap mode and run mysql_install_db only on upgrade in debian #365

Merged
merged 1 commit into from
Feb 29, 2016

Conversation

tplavcic
Copy link
Member

BUGS:
Package upgrade on Ubuntu runs mysql_install_db even though data directory already exists
https://bugs.launchpad.net/percona-server/+bug/1457614
Debian package ignores GTID options when restarts server
https://bugs.launchpad.net/percona-server/+bug/1507812

INFO:
It's needed to run mysql_install_db in debian packaging only on install and not on upgrade and also there's a fix for running bootstrap mode with --skip-log-bin so that those statements don't get into bin log without GTID's and mess the numbering. This does not affect 5.7 so it will be only null merge here for 5.7.

TEST BUILD:
http://jenkins.percona.com/job/percona-server-5.6-debian-binary/73/

TEST:
So it can be seen below that before the upgrade GTID's stopped at 2 and after upgrade and inserting 2 rows they continued at 3 and 4.

BEFORE UPGRADE:

vagrant@t-ubuntu1404-64:~$ dpkg -l|grep percona
ii  libperconaserverclient18.1          5.6.27-75.0-1.trusty                amd64        Percona Server database client library
ii  percona-server-client-5.6           5.6.27-75.0-1.trusty                amd64        Percona Server database client binaries
ii  percona-server-common-5.6           5.6.27-75.0-1.trusty                amd64        Percona Server database common files (e.g. /etc/mysql/my.cnf)
ii  percona-server-server-5.6           5.6.27-75.0-1.trusty                amd64        Percona Server database server binaries

mysql> use test;
Database changed
mysql> create table test1(age int);
Query OK, 0 rows affected (0.23 sec)

mysql> insert into test1 values (1);
Query OK, 1 row affected (0.00 sec)

mysql> insert into test1 values (2);                                                                                                                                                                                                   
Query OK, 1 row affected (0.01 sec)

root@t-ubuntu1404-64:/var/lib/mysql# mysqlbinlog mysql-bin.000001 |grep GTID
#160217  2:06:00 server id 1  end_log_pos 151 CRC32 0x1c34d999  Previous-GTIDs
#160217  2:06:47 server id 1  end_log_pos 199 CRC32 0xa2b56ad2  GTID [commit=yes]
SET @@SESSION.GTID_NEXT= '9d78f43c-d55d-11e5-bcd8-080027501f8c:1'/*!*/;
#160217  2:08:00 server id 1  end_log_pos 348 CRC32 0x16aa4f41  GTID [commit=yes]
SET @@SESSION.GTID_NEXT= '9d78f43c-d55d-11e5-bcd8-080027501f8c:2'/*!*/;
SET @@SESSION.GTID_NEXT= 'AUTOMATIC' /* added by mysqlbinlog *//*!*/;

root@t-ubuntu1404-64:/var/lib/mysql# ls -1|grep bin
mysql-bin.000001
mysql-bin.index

UPGRADE:

vagrant@t-ubuntu1404-64:~$ sudo dpkg -i percona-server-server-5.6_5.6.27-76.0-1.trusty_amd64.deb 
(Reading database ... 104073 files and directories currently installed.)
Preparing to unpack percona-server-server-5.6_5.6.27-76.0-1.trusty_amd64.deb ...
 * Stopping MySQL (Percona Server) mysqld
   ...done.
 * Stopping MySQL (Percona Server) mysqld
   ...done.
Unpacking percona-server-server-5.6 (5.6.27-76.0-1.trusty) over (5.6.27-75.0-1.trusty) ...
Setting up percona-server-server-5.6 (5.6.27-76.0-1.trusty) ...
 * Stopping MySQL (Percona Server) mysqld
   ...done.

 * Percona Server is distributed with several useful UDF (User Defined Function) from Percona Toolkit.
 * Run the following commands to create these functions:

        mysql -e "CREATE FUNCTION fnv1a_64 RETURNS INTEGER SONAME 'libfnv1a_udf.so'"
        mysql -e "CREATE FUNCTION fnv_64 RETURNS INTEGER SONAME 'libfnv_udf.so'"
        mysql -e "CREATE FUNCTION murmur_hash RETURNS INTEGER SONAME 'libmurmur_udf.so'"

 * See http://www.percona.com/doc/percona-server/5.6/management/udf_percona_toolkit.html for more details

 * Starting MySQL (Percona Server) database server mysqld
   ...done.
 * Checking for corrupt, not cleanly closed and upgrade needing tables.
Processing triggers for ureadahead (0.100.0-16) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...

AFTER UPGRADE AND INSERTING NEW DATA:

mysql> use test;
Database changed

mysql> insert into test1 values (3);                                                                                                                                                                                                   
Query OK, 1 row affected (0.02 sec)

mysql> insert into test1 values (4);                                                                                                                                                                                                   
Query OK, 1 row affected (0.01 sec)

root@t-ubuntu1404-64:/var/lib/mysql# ls -1|grep bin
mysql-bin.000001
mysql-bin.000002
mysql-bin.index

root@t-ubuntu1404-64:/var/lib/mysql# mysqlbinlog mysql-bin.000002|grep GTID
#160217  2:11:50 server id 1  end_log_pos 191 CRC32 0x4558d77f  Previous-GTIDs
#160217  2:13:17 server id 1  end_log_pos 239 CRC32 0xc7610c75  GTID [commit=yes]
SET @@SESSION.GTID_NEXT= '9d78f43c-d55d-11e5-bcd8-080027501f8c:3'/*!*/;
#160217  2:13:19 server id 1  end_log_pos 499 CRC32 0x074afe7c  GTID [commit=yes]
SET @@SESSION.GTID_NEXT= '9d78f43c-d55d-11e5-bcd8-080027501f8c:4'/*!*/;
SET @@SESSION.GTID_NEXT= 'AUTOMATIC' /* added by mysqlbinlog *//*!*/;

only on package upgrade in debian/ubuntu (#1507812, #1457614)
@tplavcic tplavcic assigned abychko and vlad-lesin and unassigned abychko Feb 17, 2016
tplavcic added a commit that referenced this pull request Feb 29, 2016
5.5 - Add --skip-log-bin for bootstrap mode and run mysql_install_db only on upgrade in debian
@tplavcic tplavcic merged commit a5948e7 into percona:5.5 Feb 29, 2016
@tplavcic tplavcic deleted the bug1507812-5.5 branch April 7, 2016 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants