From 4390c854ca9a2433b90bfbb9335b09235f68b323 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Sun, 11 Feb 2018 09:30:09 +0200 Subject: [PATCH 01/48] v1.0.44 --- RELEASE_VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE_VERSION b/RELEASE_VERSION index 4ad595c..6ae122f 100644 --- a/RELEASE_VERSION +++ b/RELEASE_VERSION @@ -1 +1 @@ -1.0.42 +1.0.44 From e346ecf11f101922e441f4ecd4106fd4d9fcaa11 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Sun, 11 Feb 2018 13:33:40 +0200 Subject: [PATCH 02/48] Adding localtests via gh-ost-ci-env --- .travis.yml | 8 ++++++++ script/cibuild | 2 ++ script/localtests | 13 +++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 script/localtests diff --git a/.travis.yml b/.travis.yml index 3006208..203ff86 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,14 @@ os: env: - MYSQL_USER=root +- CURRENT_CI_ENV=travis + +addons: + apt: + packages: + - git + - numactl + - libaio1 before_install: - mysql -e 'CREATE DATABASE IF NOT EXISTS test;' diff --git a/script/cibuild b/script/cibuild index 7e757b5..fb9955d 100755 --- a/script/cibuild +++ b/script/cibuild @@ -15,3 +15,5 @@ cd .gopath/src/github.com/github/gh-ost echo "Running unit tests" go test ./go/... + +. script/localtests diff --git a/script/localtests b/script/localtests new file mode 100644 index 0000000..a896581 --- /dev/null +++ b/script/localtests @@ -0,0 +1,13 @@ +#!/bin/bash + +set -e + +git clone https://github.com/github/gh-ost-ci-env.git +mkdir -p ~/opt/mysql +mkdir -p ~/sandboxes +gh-ost-ci-env/bin/linux/dbdeployer unpack gh-ost-ci-env/mysql-tarballs/5.7.21.tar.gz --unpack-version=5.7.21 + +echo '~/sandboxes/rsandbox_5_7_21/m "$@"' >> gh-ost-ci-env/bin/gh-ost-test-mysql-master +echo '~/sandboxes/rsandbox_5_7_21/s1 "$@"' >> gh-ost-ci-env/bin/gh-ost-test-mysql-replica + +export PATH="${HOME}/gh-ost-ci-env/bin/:${PATH}" From 18285073d9fa5a376b75e6e4f095eadd6b655df7 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Sun, 11 Feb 2018 13:41:40 +0200 Subject: [PATCH 03/48] full local tests --- script/localtests | 2 ++ 1 file changed, 2 insertions(+) diff --git a/script/localtests b/script/localtests index a896581..81ca42c 100644 --- a/script/localtests +++ b/script/localtests @@ -11,3 +11,5 @@ echo '~/sandboxes/rsandbox_5_7_21/m "$@"' >> gh-ost-ci-env/bin/gh-ost-test-mysql echo '~/sandboxes/rsandbox_5_7_21/s1 "$@"' >> gh-ost-ci-env/bin/gh-ost-test-mysql-replica export PATH="${HOME}/gh-ost-ci-env/bin/:${PATH}" +echo "# Running localtests" +./localtests/test.sh From 64b4cd62e3a4a44a768eb94d3889c22d7cf1d609 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Sun, 11 Feb 2018 13:43:49 +0200 Subject: [PATCH 04/48] relaxed idempotent commands --- script/localtests | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/localtests b/script/localtests index 81ca42c..9fb14ec 100644 --- a/script/localtests +++ b/script/localtests @@ -2,10 +2,10 @@ set -e -git clone https://github.com/github/gh-ost-ci-env.git +[ -d "gh-ost-ci-env" ] || git clone https://github.com/github/gh-ost-ci-env.git mkdir -p ~/opt/mysql mkdir -p ~/sandboxes -gh-ost-ci-env/bin/linux/dbdeployer unpack gh-ost-ci-env/mysql-tarballs/5.7.21.tar.gz --unpack-version=5.7.21 +gh-ost-ci-env/bin/linux/dbdeployer unpack gh-ost-ci-env/mysql-tarballs/5.7.21.tar.gz --unpack-version=5.7.21 || : echo '~/sandboxes/rsandbox_5_7_21/m "$@"' >> gh-ost-ci-env/bin/gh-ost-test-mysql-master echo '~/sandboxes/rsandbox_5_7_21/s1 "$@"' >> gh-ost-ci-env/bin/gh-ost-test-mysql-replica From 511ee3f8aaa8112a484f058cd7a6211cf15f8994 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Sun, 11 Feb 2018 13:46:27 +0200 Subject: [PATCH 05/48] script cleanup --- script/localtests | 3 +++ 1 file changed, 3 insertions(+) diff --git a/script/localtests b/script/localtests index 9fb14ec..80326b3 100644 --- a/script/localtests +++ b/script/localtests @@ -7,7 +7,10 @@ mkdir -p ~/opt/mysql mkdir -p ~/sandboxes gh-ost-ci-env/bin/linux/dbdeployer unpack gh-ost-ci-env/mysql-tarballs/5.7.21.tar.gz --unpack-version=5.7.21 || : +sed '/sandboxes/d' -i gh-ost-ci-env/bin/gh-ost-test-mysql-master echo '~/sandboxes/rsandbox_5_7_21/m "$@"' >> gh-ost-ci-env/bin/gh-ost-test-mysql-master + +sed '/sandboxes/d' -i gh-ost-ci-env/bin/gh-ost-test-mysql-replica echo '~/sandboxes/rsandbox_5_7_21/s1 "$@"' >> gh-ost-ci-env/bin/gh-ost-test-mysql-replica export PATH="${HOME}/gh-ost-ci-env/bin/:${PATH}" From 4ebefea02a4b00b67e3f7c38e95f668e97d39864 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Sun, 11 Feb 2018 14:05:05 +0200 Subject: [PATCH 06/48] fixed sandboxes installation path --- script/localtests | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/script/localtests b/script/localtests index 80326b3..02f5ceb 100644 --- a/script/localtests +++ b/script/localtests @@ -2,17 +2,20 @@ set -e -[ -d "gh-ost-ci-env" ] || git clone https://github.com/github/gh-ost-ci-env.git -mkdir -p ~/opt/mysql -mkdir -p ~/sandboxes -gh-ost-ci-env/bin/linux/dbdeployer unpack gh-ost-ci-env/mysql-tarballs/5.7.21.tar.gz --unpack-version=5.7.21 || : +git clone https://github.com/github/gh-ost-ci-env.git + +mkdir -p sandbox/binary +gh-ost-ci-env/bin/linux/dbdeployer unpack gh-ost-ci-env/mysql-tarballs/5.7.21.tar.gz --unpack-version=5.7.21 --sandbox-binary ${PWD}/sandbox/binary + +mkdir -p sandboxes +gh-ost-ci-env/bin/linux/dbdeployer replication 5.7.21 --nodes 2 --sandbox-binary ${PWD}/sandbox/binary --sandbox-home ${PWD}/sandboxes sed '/sandboxes/d' -i gh-ost-ci-env/bin/gh-ost-test-mysql-master -echo '~/sandboxes/rsandbox_5_7_21/m "$@"' >> gh-ost-ci-env/bin/gh-ost-test-mysql-master +echo 'sandboxes/rsandbox_5_7_21/m "$@"' >> gh-ost-ci-env/bin/gh-ost-test-mysql-master sed '/sandboxes/d' -i gh-ost-ci-env/bin/gh-ost-test-mysql-replica -echo '~/sandboxes/rsandbox_5_7_21/s1 "$@"' >> gh-ost-ci-env/bin/gh-ost-test-mysql-replica +echo 'sandboxes/rsandbox_5_7_21/s1 "$@"' >> gh-ost-ci-env/bin/gh-ost-test-mysql-replica -export PATH="${HOME}/gh-ost-ci-env/bin/:${PATH}" +export PATH="${PWD}/gh-ost-ci-env/bin/:${PATH}" echo "# Running localtests" ./localtests/test.sh From dba1490b65b1763b8b448e36f79feddb42ec3d47 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Sun, 11 Feb 2018 14:06:09 +0200 Subject: [PATCH 07/48] relaxed idempotent commands --- script/localtests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/localtests b/script/localtests index 02f5ceb..8e563c4 100644 --- a/script/localtests +++ b/script/localtests @@ -2,7 +2,7 @@ set -e -git clone https://github.com/github/gh-ost-ci-env.git +[ -d "gh-ost-ci-env" ] || git clone https://github.com/github/gh-ost-ci-env.git mkdir -p sandbox/binary gh-ost-ci-env/bin/linux/dbdeployer unpack gh-ost-ci-env/mysql-tarballs/5.7.21.tar.gz --unpack-version=5.7.21 --sandbox-binary ${PWD}/sandbox/binary From 4515e91490b3115f65ad4b91d5fe8c7972967d25 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Sun, 11 Feb 2018 14:08:39 +0200 Subject: [PATCH 08/48] tests more verbose --- localtests/test.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/localtests/test.sh b/localtests/test.sh index 477ecbb..6439b9b 100755 --- a/localtests/test.sh +++ b/localtests/test.sh @@ -26,6 +26,7 @@ verify_master_and_replica() { exit 1 fi read master_host master_port <<< $(gh-ost-test-mysql-master -e "select @@hostname, @@port" -ss) + echo "# master verified at $master_host:$master_port" if [ "$(gh-ost-test-mysql-replica -e "select 1" -ss)" != "1" ] ; then echo "Cannot verify gh-ost-test-mysql-replica" exit 1 @@ -35,6 +36,7 @@ verify_master_and_replica() { exit 1 fi read replica_host replica_port <<< $(gh-ost-test-mysql-replica -e "select @@hostname, @@port" -ss) + echo "# replica verified at $replica_host:$replica_port" } exec_cmd() { From c9cf4cf29d7b59a0248de6fc9ce7eb946ada70fc Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Sun, 11 Feb 2018 14:10:00 +0200 Subject: [PATCH 09/48] more cleanup --- script/localtests | 2 ++ 1 file changed, 2 insertions(+) diff --git a/script/localtests b/script/localtests index 8e563c4..3c3f674 100644 --- a/script/localtests +++ b/script/localtests @@ -5,9 +5,11 @@ set -e [ -d "gh-ost-ci-env" ] || git clone https://github.com/github/gh-ost-ci-env.git mkdir -p sandbox/binary +rm -rf /sandbox/binary/* gh-ost-ci-env/bin/linux/dbdeployer unpack gh-ost-ci-env/mysql-tarballs/5.7.21.tar.gz --unpack-version=5.7.21 --sandbox-binary ${PWD}/sandbox/binary mkdir -p sandboxes +rm -rf sandboxes/* gh-ost-ci-env/bin/linux/dbdeployer replication 5.7.21 --nodes 2 --sandbox-binary ${PWD}/sandbox/binary --sandbox-home ${PWD}/sandboxes sed '/sandboxes/d' -i gh-ost-ci-env/bin/gh-ost-test-mysql-master From 9e95967748afa4b165fc2bd9360621dc84144e46 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Sun, 11 Feb 2018 14:10:53 +0200 Subject: [PATCH 10/48] more cleanup --- script/localtests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/localtests b/script/localtests index 3c3f674..0aae6b6 100644 --- a/script/localtests +++ b/script/localtests @@ -5,7 +5,7 @@ set -e [ -d "gh-ost-ci-env" ] || git clone https://github.com/github/gh-ost-ci-env.git mkdir -p sandbox/binary -rm -rf /sandbox/binary/* +rm -rf sandbox/binary/* gh-ost-ci-env/bin/linux/dbdeployer unpack gh-ost-ci-env/mysql-tarballs/5.7.21.tar.gz --unpack-version=5.7.21 --sandbox-binary ${PWD}/sandbox/binary mkdir -p sandboxes From 27b8413d505aeec0b6013b21219c1b9ae01e9d95 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Sun, 11 Feb 2018 14:14:43 +0200 Subject: [PATCH 11/48] activating sandboxes --- script/localtests | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/script/localtests b/script/localtests index 0aae6b6..99e1d24 100644 --- a/script/localtests +++ b/script/localtests @@ -18,6 +18,10 @@ echo 'sandboxes/rsandbox_5_7_21/m "$@"' >> gh-ost-ci-env/bin/gh-ost-test-mysql-m sed '/sandboxes/d' -i gh-ost-ci-env/bin/gh-ost-test-mysql-replica echo 'sandboxes/rsandbox_5_7_21/s1 "$@"' >> gh-ost-ci-env/bin/gh-ost-test-mysql-replica +sandboxes/rsandbox_5_7_21/restart_all + export PATH="${PWD}/gh-ost-ci-env/bin/:${PATH}" echo "# Running localtests" ./localtests/test.sh + +sandboxes/rsandbox_5_7_21/stop_all From dbda059e0c96d79171114d6ada4e83066661f023 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Sun, 11 Feb 2018 14:15:38 +0200 Subject: [PATCH 12/48] stopping sandboxes on startup --- script/localtests | 2 ++ 1 file changed, 2 insertions(+) diff --git a/script/localtests b/script/localtests index 99e1d24..665fe8d 100644 --- a/script/localtests +++ b/script/localtests @@ -4,6 +4,8 @@ set -e [ -d "gh-ost-ci-env" ] || git clone https://github.com/github/gh-ost-ci-env.git +find sandboxes -name "stop_all" || : + mkdir -p sandbox/binary rm -rf sandbox/binary/* gh-ost-ci-env/bin/linux/dbdeployer unpack gh-ost-ci-env/mysql-tarballs/5.7.21.tar.gz --unpack-version=5.7.21 --sandbox-binary ${PWD}/sandbox/binary From 0d8c4262dcf0b97fb23288d930ff369c742b0050 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Sun, 11 Feb 2018 14:21:38 +0200 Subject: [PATCH 13/48] Adding grants --- script/localtests | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/script/localtests b/script/localtests index 665fe8d..d2a3dcf 100644 --- a/script/localtests +++ b/script/localtests @@ -20,9 +20,10 @@ echo 'sandboxes/rsandbox_5_7_21/m "$@"' >> gh-ost-ci-env/bin/gh-ost-test-mysql-m sed '/sandboxes/d' -i gh-ost-ci-env/bin/gh-ost-test-mysql-replica echo 'sandboxes/rsandbox_5_7_21/s1 "$@"' >> gh-ost-ci-env/bin/gh-ost-test-mysql-replica -sandboxes/rsandbox_5_7_21/restart_all - export PATH="${PWD}/gh-ost-ci-env/bin/:${PATH}" + +gh-ost-test-mysql-master -uroot -e "grant all on *.* to 'gh-ost'@'%' identified by 'gh-ost'" + echo "# Running localtests" ./localtests/test.sh From 674c582d2acda21ebb7e21f13cc0e1aee6e74309 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Sun, 11 Feb 2018 14:33:39 +0200 Subject: [PATCH 14/48] whoami --- script/localtests | 2 ++ 1 file changed, 2 insertions(+) diff --git a/script/localtests b/script/localtests index d2a3dcf..44d4940 100644 --- a/script/localtests +++ b/script/localtests @@ -2,6 +2,8 @@ set -e +whoami + [ -d "gh-ost-ci-env" ] || git clone https://github.com/github/gh-ost-ci-env.git find sandboxes -name "stop_all" || : From fa120b1f56c69296042a6a49d3f03af9edc2ac9d Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Sun, 11 Feb 2018 14:39:57 +0200 Subject: [PATCH 15/48] stop all --- script/localtests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/localtests b/script/localtests index 44d4940..b6fa512 100644 --- a/script/localtests +++ b/script/localtests @@ -6,7 +6,7 @@ whoami [ -d "gh-ost-ci-env" ] || git clone https://github.com/github/gh-ost-ci-env.git -find sandboxes -name "stop_all" || : +find sandboxes -name "stop_all" | bash mkdir -p sandbox/binary rm -rf sandbox/binary/* From 9b0efd0d9324558acb1e54629b7ba83b57e128bf Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Sun, 11 Feb 2018 14:58:16 +0200 Subject: [PATCH 16/48] delegating to 127.0.0.1 --- go/cmd/gh-ost/main.go | 1 - localtests/test.sh | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go/cmd/gh-ost/main.go b/go/cmd/gh-ost/main.go index 74d0f05..6d29fc4 100644 --- a/go/cmd/gh-ost/main.go +++ b/go/cmd/gh-ost/main.go @@ -44,7 +44,6 @@ func acceptSignals(migrationContext *base.MigrationContext) { // main is the application's entry point. It will either spawn a CLI or HTTP interfaces. func main() { migrationContext := base.NewMigrationContext() - flag.StringVar(&migrationContext.InspectorConnectionConfig.Key.Hostname, "host", "127.0.0.1", "MySQL hostname (preferably a replica, not the master)") flag.StringVar(&migrationContext.AssumeMasterHostname, "assume-master-host", "", "(optional) explicitly tell gh-ost the identity of the master. Format: some.host.com[:port] This is useful in master-master setups where you wish to pick an explicit master, or in a tungsten-replicator where gh-ost is unable to determine the master") flag.IntVar(&migrationContext.InspectorConnectionConfig.Key.Port, "port", 3306, "MySQL port (preferably a replica, not the master)") diff --git a/localtests/test.sh b/localtests/test.sh index 6439b9b..6bc5292 100755 --- a/localtests/test.sh +++ b/localtests/test.sh @@ -26,6 +26,7 @@ verify_master_and_replica() { exit 1 fi read master_host master_port <<< $(gh-ost-test-mysql-master -e "select @@hostname, @@port" -ss) + [ "$master_host" == "$(hostname)" ] && master_host="127.0.0.1" echo "# master verified at $master_host:$master_port" if [ "$(gh-ost-test-mysql-replica -e "select 1" -ss)" != "1" ] ; then echo "Cannot verify gh-ost-test-mysql-replica" @@ -36,6 +37,7 @@ verify_master_and_replica() { exit 1 fi read replica_host replica_port <<< $(gh-ost-test-mysql-replica -e "select @@hostname, @@port" -ss) + [ "$replica_host" == "$(hostname)" ] && replica_host="127.0.0.1" echo "# replica verified at $replica_host:$replica_port" } @@ -100,6 +102,7 @@ test_single() { --password=gh-ost \ --host=$replica_host \ --port=$replica_port \ + --assume-master-host=${master_host}:${master_port} --database=test \ --table=gh_ost_test \ --alter='engine=innodb' \ From abb1be8a2e63df69c8bad9ac2216ed52c639dc67 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Sun, 11 Feb 2018 15:02:00 +0200 Subject: [PATCH 17/48] adding log-slave-updates --- script/localtests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/localtests b/script/localtests index b6fa512..0991a8b 100644 --- a/script/localtests +++ b/script/localtests @@ -14,7 +14,7 @@ gh-ost-ci-env/bin/linux/dbdeployer unpack gh-ost-ci-env/mysql-tarballs/5.7.21.ta mkdir -p sandboxes rm -rf sandboxes/* -gh-ost-ci-env/bin/linux/dbdeployer replication 5.7.21 --nodes 2 --sandbox-binary ${PWD}/sandbox/binary --sandbox-home ${PWD}/sandboxes +gh-ost-ci-env/bin/linux/dbdeployer replication 5.7.21 --nodes 2 --sandbox-binary ${PWD}/sandbox/binary --sandbox-home ${PWD}/sandboxes --my-cnf-options log_slave_updates --my-cnf-options log_bin --my-cnf-options binlog_format=ROW sed '/sandboxes/d' -i gh-ost-ci-env/bin/gh-ost-test-mysql-master echo 'sandboxes/rsandbox_5_7_21/m "$@"' >> gh-ost-ci-env/bin/gh-ost-test-mysql-master From 3d59f2fbd29ef1d272c54d1fcd47c0bacd7c97f9 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Sun, 11 Feb 2018 15:03:42 +0200 Subject: [PATCH 18/48] /tmp path --- localtests/test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/localtests/test.sh b/localtests/test.sh index 6bc5292..97db2d6 100755 --- a/localtests/test.sh +++ b/localtests/test.sh @@ -11,8 +11,8 @@ tests_path=$(dirname $0) test_logfile=/tmp/gh-ost-test.log ghost_binary=/tmp/gh-ost-test exec_command_file=/tmp/gh-ost-test.bash -orig_content_output_file=/gh-ost-test.orig.content.csv -ghost_content_output_file=/gh-ost-test.ghost.content.csv +orig_content_output_file=/tmp/gh-ost-test.orig.content.csv +ghost_content_output_file=/tmp/gh-ost-test.ghost.content.csv test_pattern="${1:-.}" master_host= From 06b7b06b0547b2cd66e22fdbfd0211786d9091ac Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Sun, 11 Feb 2018 15:13:03 +0200 Subject: [PATCH 19/48] gtid based replication --- script/localtests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/localtests b/script/localtests index 0991a8b..51e66aa 100644 --- a/script/localtests +++ b/script/localtests @@ -14,7 +14,7 @@ gh-ost-ci-env/bin/linux/dbdeployer unpack gh-ost-ci-env/mysql-tarballs/5.7.21.ta mkdir -p sandboxes rm -rf sandboxes/* -gh-ost-ci-env/bin/linux/dbdeployer replication 5.7.21 --nodes 2 --sandbox-binary ${PWD}/sandbox/binary --sandbox-home ${PWD}/sandboxes --my-cnf-options log_slave_updates --my-cnf-options log_bin --my-cnf-options binlog_format=ROW +gh-ost-ci-env/bin/linux/dbdeployer replication 5.7.21 --nodes 2 --sandbox-binary ${PWD}/sandbox/binary --sandbox-home ${PWD}/sandboxes --gtid --my-cnf-options log_slave_updates --my-cnf-options log_bin --my-cnf-options binlog_format=ROW sed '/sandboxes/d' -i gh-ost-ci-env/bin/gh-ost-test-mysql-master echo 'sandboxes/rsandbox_5_7_21/m "$@"' >> gh-ost-ci-env/bin/gh-ost-test-mysql-master From 482a521253d1588e2b53c031153a711c66e12763 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Mon, 12 Feb 2018 11:14:40 +0200 Subject: [PATCH 20/48] outputting test log file on error --- localtests/test.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/localtests/test.sh b/localtests/test.sh index 97db2d6..71df2c5 100755 --- a/localtests/test.sh +++ b/localtests/test.sh @@ -153,7 +153,8 @@ test_single() { if [ $execution_result -ne 0 ] ; then echo - echo "ERROR $test_name execution failure. cat $test_logfile" + echo "ERROR $test_name execution failure. cat $test_logfile:" + cat $test_logfile return 1 fi From 427d8a4551dff1f9ec655dceb1a3ce23eb0087d2 Mon Sep 17 00:00:00 2001 From: Gillian Gunson Date: Fri, 16 Feb 2018 13:51:20 -0800 Subject: [PATCH 21/48] added teammates to authors list --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 0d896bd..2138109 100644 --- a/README.md +++ b/README.md @@ -107,3 +107,5 @@ Generally speaking, `master` branch is stable, but only [releases](https://githu - [@ggunson](https://github.com/ggunson) - [@tomkrouper](https://github.com/tomkrouper) - [@shlomi-noach](https://github.com/shlomi-noach) +- [@jessbreckenridge](https://github.com/jessbreckenridge) +- [@gtowey](https://github.com/gtowey) From a2a06ad67f0ea1c5b1aeb8ef713761892498b03f Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Tue, 20 Feb 2018 15:53:30 +0200 Subject: [PATCH 22/48] script/localtests is a separate test --- .travis.yml | 4 +++- script/cibuild | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 203ff86..cd386d8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,9 @@ before_install: install: true -script: script/cibuild +script: + - script/cibuild + - script/localtests notifications: email: false diff --git a/script/cibuild b/script/cibuild index fb9955d..7e757b5 100755 --- a/script/cibuild +++ b/script/cibuild @@ -15,5 +15,3 @@ cd .gopath/src/github.com/github/gh-ost echo "Running unit tests" go test ./go/... - -. script/localtests From 34a55f1518c8549a77f680937819f0f478cba64c Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Tue, 20 Feb 2018 15:56:10 +0200 Subject: [PATCH 23/48] script/localtests is excutable --- script/localtests | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 script/localtests diff --git a/script/localtests b/script/localtests old mode 100644 new mode 100755 From 9ae9cef17a918319c75be547943588e869f751d9 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Sun, 25 Feb 2018 19:17:37 +0200 Subject: [PATCH 24/48] support quoted values in interactive commands --- go/logic/server.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/go/logic/server.go b/go/logic/server.go index b9903e2..919f178 100644 --- a/go/logic/server.go +++ b/go/logic/server.go @@ -130,6 +130,9 @@ func (this *Server) applyServerCommand(command string, writer *bufio.Writer) (pr arg := "" if len(tokens) > 1 { arg = strings.TrimSpace(tokens[1]) + if unquoted, err := strconv.Unquote(arg); err == nil { + arg = unquoted + } } argIsQuestion := (arg == "?") throttleHint := "# Note: you may only throttle for as long as your binary logs are not purged\n" From 540001b283d2e04f84b295d8af8332216ff4419c Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Mon, 26 Feb 2018 14:00:23 +0200 Subject: [PATCH 25/48] temporarily removing localtests from travis --- .travis.yml | 1 - script/{localtests => cibuild-gh-ost-replica-tests} | 0 2 files changed, 1 deletion(-) rename script/{localtests => cibuild-gh-ost-replica-tests} (100%) diff --git a/.travis.yml b/.travis.yml index cd386d8..92cb79c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,6 @@ install: true script: - script/cibuild - - script/localtests notifications: email: false diff --git a/script/localtests b/script/cibuild-gh-ost-replica-tests similarity index 100% rename from script/localtests rename to script/cibuild-gh-ost-replica-tests From 00a4d1f9604040fc0bab0395410ce41a30b39300 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Mon, 26 Feb 2018 14:32:58 +0200 Subject: [PATCH 26/48] prebuilt binary for localtests --- localtests/test.sh | 24 +++++++++++++++++++++--- script/cibuild-gh-ost-replica-tests | 3 ++- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/localtests/test.sh b/localtests/test.sh index 71df2c5..db34f85 100755 --- a/localtests/test.sh +++ b/localtests/test.sh @@ -9,17 +9,30 @@ tests_path=$(dirname $0) test_logfile=/tmp/gh-ost-test.log -ghost_binary=/tmp/gh-ost-test +default_ghost_binary=/tmp/gh-ost-test +ghost_binary="" exec_command_file=/tmp/gh-ost-test.bash orig_content_output_file=/tmp/gh-ost-test.orig.content.csv ghost_content_output_file=/tmp/gh-ost-test.ghost.content.csv -test_pattern="${1:-.}" master_host= master_port= replica_host= replica_port= +OPTIND=1 +while getopts "b:" OPTION +do + case $OPTION in + b) + ghost_binary="$OPTARG" + ;; + esac +done +shift $((OPTIND-1)) + +test_pattern="${1:-.}" + verify_master_and_replica() { if [ "$(gh-ost-test-mysql-master -e "select 1" -ss)" != "1" ] ; then echo "Cannot verify gh-ost-test-mysql-master" @@ -176,7 +189,12 @@ test_single() { build_binary() { echo "Building" - rm -f $ghost_binary + rm -f $default_ghost_binary + [ "$ghost_binary" == "" ] && ghost_binary="$default_ghost_binary" + if [ -f "$ghost_binary" ] ; then + echo "Using binary: $ghost_binary" + return 0 + fi go build -o $ghost_binary go/cmd/gh-ost/main.go if [ $? -ne 0 ] ; then echo "Build failure" diff --git a/script/cibuild-gh-ost-replica-tests b/script/cibuild-gh-ost-replica-tests index 51e66aa..56d7b62 100755 --- a/script/cibuild-gh-ost-replica-tests +++ b/script/cibuild-gh-ost-replica-tests @@ -27,6 +27,7 @@ export PATH="${PWD}/gh-ost-ci-env/bin/:${PATH}" gh-ost-test-mysql-master -uroot -e "grant all on *.* to 'gh-ost'@'%' identified by 'gh-ost'" echo "# Running localtests" -./localtests/test.sh +. script/build +./localtests/test.sh -b bin/gh-ost sandboxes/rsandbox_5_7_21/stop_all From 8e3694bccc4595266b7d13fba4b397099d2ff9e1 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Mon, 26 Feb 2018 14:43:11 +0200 Subject: [PATCH 27/48] testing multiple versions --- script/cibuild-gh-ost-replica-tests | 44 ++++++++++++++++++----------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/script/cibuild-gh-ost-replica-tests b/script/cibuild-gh-ost-replica-tests index 56d7b62..2c8ef84 100755 --- a/script/cibuild-gh-ost-replica-tests +++ b/script/cibuild-gh-ost-replica-tests @@ -6,28 +6,38 @@ whoami [ -d "gh-ost-ci-env" ] || git clone https://github.com/github/gh-ost-ci-env.git -find sandboxes -name "stop_all" | bash +test_mysql_version() { + local mysql_version + mysql_version="$1" -mkdir -p sandbox/binary -rm -rf sandbox/binary/* -gh-ost-ci-env/bin/linux/dbdeployer unpack gh-ost-ci-env/mysql-tarballs/5.7.21.tar.gz --unpack-version=5.7.21 --sandbox-binary ${PWD}/sandbox/binary + find sandboxes -name "stop_all" | bash -mkdir -p sandboxes -rm -rf sandboxes/* -gh-ost-ci-env/bin/linux/dbdeployer replication 5.7.21 --nodes 2 --sandbox-binary ${PWD}/sandbox/binary --sandbox-home ${PWD}/sandboxes --gtid --my-cnf-options log_slave_updates --my-cnf-options log_bin --my-cnf-options binlog_format=ROW + mkdir -p sandbox/binary + rm -rf sandbox/binary/* + gh-ost-ci-env/bin/linux/dbdeployer unpack gh-ost-ci-env/mysql-tarballs/"$mysql_version".tar.gz --unpack-version="$mysql_version" --sandbox-binary ${PWD}/sandbox/binary -sed '/sandboxes/d' -i gh-ost-ci-env/bin/gh-ost-test-mysql-master -echo 'sandboxes/rsandbox_5_7_21/m "$@"' >> gh-ost-ci-env/bin/gh-ost-test-mysql-master + mkdir -p sandboxes + rm -rf sandboxes/* + gh-ost-ci-env/bin/linux/dbdeployer replication "$mysql_version" --nodes 2 --sandbox-binary ${PWD}/sandbox/binary --sandbox-home ${PWD}/sandboxes --gtid --my-cnf-options log_slave_updates --my-cnf-options log_bin --my-cnf-options binlog_format=ROW -sed '/sandboxes/d' -i gh-ost-ci-env/bin/gh-ost-test-mysql-replica -echo 'sandboxes/rsandbox_5_7_21/s1 "$@"' >> gh-ost-ci-env/bin/gh-ost-test-mysql-replica + sed '/sandboxes/d' -i gh-ost-ci-env/bin/gh-ost-test-mysql-master + echo 'sandboxes/rsandbox_5_7_21/m "$@"' >> gh-ost-ci-env/bin/gh-ost-test-mysql-master -export PATH="${PWD}/gh-ost-ci-env/bin/:${PATH}" + sed '/sandboxes/d' -i gh-ost-ci-env/bin/gh-ost-test-mysql-replica + echo 'sandboxes/rsandbox_5_7_21/s1 "$@"' >> gh-ost-ci-env/bin/gh-ost-test-mysql-replica -gh-ost-test-mysql-master -uroot -e "grant all on *.* to 'gh-ost'@'%' identified by 'gh-ost'" + export PATH="${PWD}/gh-ost-ci-env/bin/:${PATH}" -echo "# Running localtests" -. script/build -./localtests/test.sh -b bin/gh-ost + gh-ost-test-mysql-master -uroot -e "grant all on *.* to 'gh-ost'@'%' identified by 'gh-ost'" -sandboxes/rsandbox_5_7_21/stop_all + echo "# Testing $mysql_version" + . script/build + ./localtests/test.sh -b bin/gh-ost + + find sandboxes -name "stop_all" | bash +} + +# Test all versions: +find gh-ost-ci-env/mysql-tarballs/ -name "*.tar.gz" | xargs basename | sed -e 's/.tar.gz//g' | sort -r | while read mysql_version ; do + test_mysql_version "$mysql_version" +done From 29b4f93bfe6a9f88d52c349e3e05f47244e009ad Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Mon, 26 Feb 2018 14:46:25 +0200 Subject: [PATCH 28/48] fixed basename --- script/cibuild-gh-ost-replica-tests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/cibuild-gh-ost-replica-tests b/script/cibuild-gh-ost-replica-tests index 2c8ef84..d0824ef 100755 --- a/script/cibuild-gh-ost-replica-tests +++ b/script/cibuild-gh-ost-replica-tests @@ -38,6 +38,6 @@ test_mysql_version() { } # Test all versions: -find gh-ost-ci-env/mysql-tarballs/ -name "*.tar.gz" | xargs basename | sed -e 's/.tar.gz//g' | sort -r | while read mysql_version ; do +find gh-ost-ci-env/mysql-tarballs/ -name "*.tar.gz" | while read f ; do basename $f ".tar.gz" ; done | sort -r | while read mysql_version ; do test_mysql_version "$mysql_version" done From 40b53b122255f230831b46d4e7294b1ec7e52301 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Mon, 26 Feb 2018 14:48:48 +0200 Subject: [PATCH 29/48] extracting build --- script/cibuild-gh-ost-replica-tests | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/script/cibuild-gh-ost-replica-tests b/script/cibuild-gh-ost-replica-tests index d0824ef..b28982c 100755 --- a/script/cibuild-gh-ost-replica-tests +++ b/script/cibuild-gh-ost-replica-tests @@ -10,6 +10,8 @@ test_mysql_version() { local mysql_version mysql_version="$1" + echo "# Testing $mysql_version" + find sandboxes -name "stop_all" | bash mkdir -p sandbox/binary @@ -30,13 +32,13 @@ test_mysql_version() { gh-ost-test-mysql-master -uroot -e "grant all on *.* to 'gh-ost'@'%' identified by 'gh-ost'" - echo "# Testing $mysql_version" - . script/build ./localtests/test.sh -b bin/gh-ost find sandboxes -name "stop_all" | bash } +echo "Building..." +. script/build # Test all versions: find gh-ost-ci-env/mysql-tarballs/ -name "*.tar.gz" | while read f ; do basename $f ".tar.gz" ; done | sort -r | while read mysql_version ; do test_mysql_version "$mysql_version" From 0a32d822f87e286f0feb87c8d990ce20bb570720 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Mon, 26 Feb 2018 15:11:48 +0200 Subject: [PATCH 30/48] normalizinf sandbox-diectory --- script/cibuild-gh-ost-replica-tests | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/script/cibuild-gh-ost-replica-tests b/script/cibuild-gh-ost-replica-tests index b28982c..e254c1b 100755 --- a/script/cibuild-gh-ost-replica-tests +++ b/script/cibuild-gh-ost-replica-tests @@ -16,17 +16,17 @@ test_mysql_version() { mkdir -p sandbox/binary rm -rf sandbox/binary/* - gh-ost-ci-env/bin/linux/dbdeployer unpack gh-ost-ci-env/mysql-tarballs/"$mysql_version".tar.gz --unpack-version="$mysql_version" --sandbox-binary ${PWD}/sandbox/binary + gh-ost-ci-env/bin/linux/dbdeployer unpack gh-ost-ci-env/mysql-tarballs/"$mysql_version".tar.gz --unpack-version="$mysql_version" --sandbox-binary ${PWD}/sandbox/binary --sandbox-directory rsandbox mkdir -p sandboxes rm -rf sandboxes/* - gh-ost-ci-env/bin/linux/dbdeployer replication "$mysql_version" --nodes 2 --sandbox-binary ${PWD}/sandbox/binary --sandbox-home ${PWD}/sandboxes --gtid --my-cnf-options log_slave_updates --my-cnf-options log_bin --my-cnf-options binlog_format=ROW + gh-ost-ci-env/bin/linux/dbdeployer replication "$mysql_version" --nodes 2 --sandbox-binary ${PWD}/sandbox/binary --sandbox-home ${PWD}/sandboxes --gtid --my-cnf-options log_slave_updates --my-cnf-options log_bin --my-cnf-options binlog_format=ROW --sandbox-directory rsandbox sed '/sandboxes/d' -i gh-ost-ci-env/bin/gh-ost-test-mysql-master - echo 'sandboxes/rsandbox_5_7_21/m "$@"' >> gh-ost-ci-env/bin/gh-ost-test-mysql-master + echo 'sandboxes/rsandbox/m "$@"' >> gh-ost-ci-env/bin/gh-ost-test-mysql-master sed '/sandboxes/d' -i gh-ost-ci-env/bin/gh-ost-test-mysql-replica - echo 'sandboxes/rsandbox_5_7_21/s1 "$@"' >> gh-ost-ci-env/bin/gh-ost-test-mysql-replica + echo 'sandboxes/rsandbox/s1 "$@"' >> gh-ost-ci-env/bin/gh-ost-test-mysql-replica export PATH="${PWD}/gh-ost-ci-env/bin/:${PATH}" From df9dd49a4762cd2e8aed3993f8364761dc55d209 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Mon, 26 Feb 2018 15:22:50 +0200 Subject: [PATCH 31/48] support for ignored versions --- localtests/json57/ignore_versions | 1 + localtests/json57dml/ignore_versions | 1 + localtests/test.sh | 9 +++++++++ 3 files changed, 11 insertions(+) create mode 100644 localtests/json57/ignore_versions create mode 100644 localtests/json57dml/ignore_versions diff --git a/localtests/json57/ignore_versions b/localtests/json57/ignore_versions new file mode 100644 index 0000000..b6de5f8 --- /dev/null +++ b/localtests/json57/ignore_versions @@ -0,0 +1 @@ +(5.5|5.6) diff --git a/localtests/json57dml/ignore_versions b/localtests/json57dml/ignore_versions new file mode 100644 index 0000000..b6de5f8 --- /dev/null +++ b/localtests/json57dml/ignore_versions @@ -0,0 +1 @@ +(5.5|5.6) diff --git a/localtests/test.sh b/localtests/test.sh index db34f85..b78fa87 100755 --- a/localtests/test.sh +++ b/localtests/test.sh @@ -83,6 +83,15 @@ test_single() { local test_name test_name="$1" + if [ -f $tests_path/$test_name/ignore_versions ] ; then + ignore_versions=$(cat $tests_path/$test_name/ignore_versions) + mysql_version=$(gh-ost-test-mysql-master -s -s -e "select @@version") + if echo "$mysql_version" | egrep "$ignore_versions" ; then + echo "ignoring" + return 0 + fi + fi + echo -n "Testing: $test_name" echo_dot From 8f9f6c10399c56d014e32801afca66ed910fd885 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Mon, 26 Feb 2018 15:22:57 +0200 Subject: [PATCH 32/48] more verbose --- script/cibuild-gh-ost-replica-tests | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/script/cibuild-gh-ost-replica-tests b/script/cibuild-gh-ost-replica-tests index e254c1b..1e44035 100755 --- a/script/cibuild-gh-ost-replica-tests +++ b/script/cibuild-gh-ost-replica-tests @@ -10,7 +10,9 @@ test_mysql_version() { local mysql_version mysql_version="$1" - echo "# Testing $mysql_version" + echo "##### Testing $mysql_version" + + echo "### Setting up sandbox for $mysql_version" find sandboxes -name "stop_all" | bash @@ -32,6 +34,7 @@ test_mysql_version() { gh-ost-test-mysql-master -uroot -e "grant all on *.* to 'gh-ost'@'%' identified by 'gh-ost'" + echo "### Running gh-ost tests for $mysql_version" ./localtests/test.sh -b bin/gh-ost find sandboxes -name "stop_all" | bash From 9cfbfbf306a82af609f539452bff63358048efe1 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Mon, 26 Feb 2018 15:41:21 +0200 Subject: [PATCH 33/48] disable gtid for 5.5 --- script/cibuild-gh-ost-replica-tests | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/script/cibuild-gh-ost-replica-tests b/script/cibuild-gh-ost-replica-tests index 1e44035..a1fa646 100755 --- a/script/cibuild-gh-ost-replica-tests +++ b/script/cibuild-gh-ost-replica-tests @@ -22,7 +22,13 @@ test_mysql_version() { mkdir -p sandboxes rm -rf sandboxes/* - gh-ost-ci-env/bin/linux/dbdeployer replication "$mysql_version" --nodes 2 --sandbox-binary ${PWD}/sandbox/binary --sandbox-home ${PWD}/sandboxes --gtid --my-cnf-options log_slave_updates --my-cnf-options log_bin --my-cnf-options binlog_format=ROW --sandbox-directory rsandbox + + if echo "$mysql_version" | egrep "5[.]5[.]" ; then + gtid="" + else + gtid="--gtid" + fi + gh-ost-ci-env/bin/linux/dbdeployer replication "$mysql_version" --nodes 2 --sandbox-binary ${PWD}/sandbox/binary --sandbox-home ${PWD}/sandboxes ${gtid} --my-cnf-options log_slave_updates --my-cnf-options log_bin --my-cnf-options binlog_format=ROW --sandbox-directory rsandbox sed '/sandboxes/d' -i gh-ost-ci-env/bin/gh-ost-test-mysql-master echo 'sandboxes/rsandbox/m "$@"' >> gh-ost-ci-env/bin/gh-ost-test-mysql-master From a9ead9e0f07f535a5536463aa01ca930c085ca11 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Mon, 26 Feb 2018 18:24:42 +0200 Subject: [PATCH 34/48] 5.5 excluded tests --- localtests/test.sh | 2 +- localtests/tz-datetime-ts/ignore_versions | 1 + localtests/tz/ignore_versions | 1 + script/cibuild-gh-ost-replica-tests | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 localtests/tz-datetime-ts/ignore_versions create mode 100644 localtests/tz/ignore_versions diff --git a/localtests/test.sh b/localtests/test.sh index b78fa87..9ab0c18 100755 --- a/localtests/test.sh +++ b/localtests/test.sh @@ -86,7 +86,7 @@ test_single() { if [ -f $tests_path/$test_name/ignore_versions ] ; then ignore_versions=$(cat $tests_path/$test_name/ignore_versions) mysql_version=$(gh-ost-test-mysql-master -s -s -e "select @@version") - if echo "$mysql_version" | egrep "$ignore_versions" ; then + if echo "$mysql_version" | egrep "^${ignore_versions}" ; then echo "ignoring" return 0 fi diff --git a/localtests/tz-datetime-ts/ignore_versions b/localtests/tz-datetime-ts/ignore_versions new file mode 100644 index 0000000..7acd3f0 --- /dev/null +++ b/localtests/tz-datetime-ts/ignore_versions @@ -0,0 +1 @@ +(5.5) diff --git a/localtests/tz/ignore_versions b/localtests/tz/ignore_versions new file mode 100644 index 0000000..7acd3f0 --- /dev/null +++ b/localtests/tz/ignore_versions @@ -0,0 +1 @@ +(5.5) diff --git a/script/cibuild-gh-ost-replica-tests b/script/cibuild-gh-ost-replica-tests index a1fa646..2e43009 100755 --- a/script/cibuild-gh-ost-replica-tests +++ b/script/cibuild-gh-ost-replica-tests @@ -49,6 +49,6 @@ test_mysql_version() { echo "Building..." . script/build # Test all versions: -find gh-ost-ci-env/mysql-tarballs/ -name "*.tar.gz" | while read f ; do basename $f ".tar.gz" ; done | sort -r | while read mysql_version ; do +find gh-ost-ci-env/mysql-tarballs/ -name "*.tar.gz" | while read f ; do basename $f ".tar.gz" ; done | sort | while read mysql_version ; do test_mysql_version "$mysql_version" done From 2d56df33046a8b2f24d071567e17f801cdb5581f Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Mon, 26 Feb 2018 18:29:45 +0200 Subject: [PATCH 35/48] 5.5 excluded tests --- localtests/timestamp-to-datetime/ignore_versions | 1 + localtests/timestamp/ignore_versions | 1 + 2 files changed, 2 insertions(+) create mode 100644 localtests/timestamp-to-datetime/ignore_versions create mode 100644 localtests/timestamp/ignore_versions diff --git a/localtests/timestamp-to-datetime/ignore_versions b/localtests/timestamp-to-datetime/ignore_versions new file mode 100644 index 0000000..7acd3f0 --- /dev/null +++ b/localtests/timestamp-to-datetime/ignore_versions @@ -0,0 +1 @@ +(5.5) diff --git a/localtests/timestamp/ignore_versions b/localtests/timestamp/ignore_versions new file mode 100644 index 0000000..7acd3f0 --- /dev/null +++ b/localtests/timestamp/ignore_versions @@ -0,0 +1 @@ +(5.5) From 242ee083631d699bb3c950976b7c9a51244a1b36 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Mon, 26 Feb 2018 18:33:38 +0200 Subject: [PATCH 36/48] 5.5 excluded tests --- localtests/swap-uk-uk/ignore_versions | 1 + 1 file changed, 1 insertion(+) create mode 100644 localtests/swap-uk-uk/ignore_versions diff --git a/localtests/swap-uk-uk/ignore_versions b/localtests/swap-uk-uk/ignore_versions new file mode 100644 index 0000000..7acd3f0 --- /dev/null +++ b/localtests/swap-uk-uk/ignore_versions @@ -0,0 +1 @@ +(5.5) From ac7765eb9f8ebad2b1014106ff2a802b0a0ff7d8 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Mon, 26 Feb 2018 18:35:55 +0200 Subject: [PATCH 37/48] 5.5 excluded tests --- localtests/swap-pk-uk/ignore_versions | 1 + 1 file changed, 1 insertion(+) create mode 100644 localtests/swap-pk-uk/ignore_versions diff --git a/localtests/swap-pk-uk/ignore_versions b/localtests/swap-pk-uk/ignore_versions new file mode 100644 index 0000000..7acd3f0 --- /dev/null +++ b/localtests/swap-pk-uk/ignore_versions @@ -0,0 +1 @@ +(5.5) From 9061d4fa5bdab4b2aac7bce5e9edf1a2e47ca3a5 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Mon, 26 Feb 2018 18:38:39 +0200 Subject: [PATCH 38/48] 5.5 excluded tests --- localtests/datetime-submillis-zeroleading/ignore_versions | 1 + localtests/datetime-submillis/ignore_versions | 1 + localtests/datetime/ignore_versions | 1 + localtests/test.sh | 2 +- 4 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 localtests/datetime-submillis-zeroleading/ignore_versions create mode 100644 localtests/datetime-submillis/ignore_versions create mode 100644 localtests/datetime/ignore_versions diff --git a/localtests/datetime-submillis-zeroleading/ignore_versions b/localtests/datetime-submillis-zeroleading/ignore_versions new file mode 100644 index 0000000..7acd3f0 --- /dev/null +++ b/localtests/datetime-submillis-zeroleading/ignore_versions @@ -0,0 +1 @@ +(5.5) diff --git a/localtests/datetime-submillis/ignore_versions b/localtests/datetime-submillis/ignore_versions new file mode 100644 index 0000000..7acd3f0 --- /dev/null +++ b/localtests/datetime-submillis/ignore_versions @@ -0,0 +1 @@ +(5.5) diff --git a/localtests/datetime/ignore_versions b/localtests/datetime/ignore_versions new file mode 100644 index 0000000..7acd3f0 --- /dev/null +++ b/localtests/datetime/ignore_versions @@ -0,0 +1 @@ +(5.5) diff --git a/localtests/test.sh b/localtests/test.sh index 9ab0c18..975eaf3 100755 --- a/localtests/test.sh +++ b/localtests/test.sh @@ -87,7 +87,7 @@ test_single() { ignore_versions=$(cat $tests_path/$test_name/ignore_versions) mysql_version=$(gh-ost-test-mysql-master -s -s -e "select @@version") if echo "$mysql_version" | egrep "^${ignore_versions}" ; then - echo "ignoring" + echo -n "Testing: $test_name" return 0 fi fi From fa9675733289f4c0afc6b4d799f5f163b4f81c70 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Mon, 26 Feb 2018 18:41:42 +0200 Subject: [PATCH 39/48] 5.5 excluded tests --- localtests/datetime-to-timestamp-pk-fail/ignore_versions | 1 + 1 file changed, 1 insertion(+) create mode 100644 localtests/datetime-to-timestamp-pk-fail/ignore_versions diff --git a/localtests/datetime-to-timestamp-pk-fail/ignore_versions b/localtests/datetime-to-timestamp-pk-fail/ignore_versions new file mode 100644 index 0000000..7acd3f0 --- /dev/null +++ b/localtests/datetime-to-timestamp-pk-fail/ignore_versions @@ -0,0 +1 @@ +(5.5) From 49b3917d2b9fa9302d79a74c1032b781b752e486 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Mon, 26 Feb 2018 18:43:41 +0200 Subject: [PATCH 40/48] skipping wording --- localtests/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/localtests/test.sh b/localtests/test.sh index 975eaf3..56bfb63 100755 --- a/localtests/test.sh +++ b/localtests/test.sh @@ -87,7 +87,7 @@ test_single() { ignore_versions=$(cat $tests_path/$test_name/ignore_versions) mysql_version=$(gh-ost-test-mysql-master -s -s -e "select @@version") if echo "$mysql_version" | egrep "^${ignore_versions}" ; then - echo -n "Testing: $test_name" + echo -n "Skipping: $test_name" return 0 fi fi From 07a4a690496d736de2290764684e65f07341494e Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Mon, 26 Feb 2018 18:44:36 +0200 Subject: [PATCH 41/48] quiet grep --- localtests/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/localtests/test.sh b/localtests/test.sh index 56bfb63..8d5ee35 100755 --- a/localtests/test.sh +++ b/localtests/test.sh @@ -86,7 +86,7 @@ test_single() { if [ -f $tests_path/$test_name/ignore_versions ] ; then ignore_versions=$(cat $tests_path/$test_name/ignore_versions) mysql_version=$(gh-ost-test-mysql-master -s -s -e "select @@version") - if echo "$mysql_version" | egrep "^${ignore_versions}" ; then + if echo "$mysql_version" | egrep -q "^${ignore_versions}" ; then echo -n "Skipping: $test_name" return 0 fi From ad87b729aa8c037c8dbaee5ad16b14b22ebbe870 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Mon, 26 Feb 2018 18:46:54 +0200 Subject: [PATCH 42/48] sort order --- script/cibuild-gh-ost-replica-tests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/cibuild-gh-ost-replica-tests b/script/cibuild-gh-ost-replica-tests index 2e43009..a1fa646 100755 --- a/script/cibuild-gh-ost-replica-tests +++ b/script/cibuild-gh-ost-replica-tests @@ -49,6 +49,6 @@ test_mysql_version() { echo "Building..." . script/build # Test all versions: -find gh-ost-ci-env/mysql-tarballs/ -name "*.tar.gz" | while read f ; do basename $f ".tar.gz" ; done | sort | while read mysql_version ; do +find gh-ost-ci-env/mysql-tarballs/ -name "*.tar.gz" | while read f ; do basename $f ".tar.gz" ; done | sort -r | while read mysql_version ; do test_mysql_version "$mysql_version" done From efe5641365b4b108fe2ab29d0111d3699eac4770 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Tue, 27 Feb 2018 13:28:29 +0200 Subject: [PATCH 43/48] directory reset --- script/cibuild-gh-ost-replica-tests | 1 + 1 file changed, 1 insertion(+) diff --git a/script/cibuild-gh-ost-replica-tests b/script/cibuild-gh-ost-replica-tests index a1fa646..b11cfa4 100755 --- a/script/cibuild-gh-ost-replica-tests +++ b/script/cibuild-gh-ost-replica-tests @@ -4,6 +4,7 @@ set -e whoami +rm -rf ./gh-ost-ci-env [ -d "gh-ost-ci-env" ] || git clone https://github.com/github/gh-ost-ci-env.git test_mysql_version() { From 5480646de9583df6d5da5a9798a829ef1e993deb Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Tue, 27 Feb 2018 13:30:36 +0200 Subject: [PATCH 44/48] adapting to dbdeployer 0.2.0 --- script/cibuild-gh-ost-replica-tests | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/cibuild-gh-ost-replica-tests b/script/cibuild-gh-ost-replica-tests index b11cfa4..1193b82 100755 --- a/script/cibuild-gh-ost-replica-tests +++ b/script/cibuild-gh-ost-replica-tests @@ -19,7 +19,7 @@ test_mysql_version() { mkdir -p sandbox/binary rm -rf sandbox/binary/* - gh-ost-ci-env/bin/linux/dbdeployer unpack gh-ost-ci-env/mysql-tarballs/"$mysql_version".tar.gz --unpack-version="$mysql_version" --sandbox-binary ${PWD}/sandbox/binary --sandbox-directory rsandbox + gh-ost-ci-env/bin/linux/dbdeployer unpack gh-ost-ci-env/mysql-tarballs/"$mysql_version".tar.gz --unpack-version="$mysql_version" --sandbox-binary ${PWD}/sandbox/binary mkdir -p sandboxes rm -rf sandboxes/* @@ -29,7 +29,7 @@ test_mysql_version() { else gtid="--gtid" fi - gh-ost-ci-env/bin/linux/dbdeployer replication "$mysql_version" --nodes 2 --sandbox-binary ${PWD}/sandbox/binary --sandbox-home ${PWD}/sandboxes ${gtid} --my-cnf-options log_slave_updates --my-cnf-options log_bin --my-cnf-options binlog_format=ROW --sandbox-directory rsandbox + gh-ost-ci-env/bin/linux/dbdeployer deploy replication "$mysql_version" --nodes 2 --sandbox-binary ${PWD}/sandbox/binary --sandbox-home ${PWD}/sandboxes ${gtid} --my-cnf-options log_slave_updates --my-cnf-options log_bin --my-cnf-options binlog_format=ROW --sandbox-directory rsandbox sed '/sandboxes/d' -i gh-ost-ci-env/bin/gh-ost-test-mysql-master echo 'sandboxes/rsandbox/m "$@"' >> gh-ost-ci-env/bin/gh-ost-test-mysql-master From 813f99fd9142ee13252e69874254fb62dfc8822f Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Tue, 27 Feb 2018 13:38:19 +0200 Subject: [PATCH 45/48] clong gh-ost-ci-env only if not same commit --- script/cibuild-gh-ost-replica-tests | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/script/cibuild-gh-ost-replica-tests b/script/cibuild-gh-ost-replica-tests index 1193b82..3cf43f6 100755 --- a/script/cibuild-gh-ost-replica-tests +++ b/script/cibuild-gh-ost-replica-tests @@ -4,8 +4,14 @@ set -e whoami -rm -rf ./gh-ost-ci-env -[ -d "gh-ost-ci-env" ] || git clone https://github.com/github/gh-ost-ci-env.git +# Clone gh-ost-ci-env +# Only clone if not already running locally at latest commit +remote_commit=$(git ls-remote https://github.com/github/gh-ost-ci-env.git HEAD | cut -f1) +local_commit=$(cd gh-ost-ci-env && git log --format="%H" -n 1) +if [ "$remote_commit" != "$local_commit" ] ; then + rm -rf ./gh-ost-ci-env + git clone https://github.com/github/gh-ost-ci-env.git +fi test_mysql_version() { local mysql_version From ae746112b1a42dccef6c122f9544ba42ddc58611 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Tue, 27 Feb 2018 13:39:19 +0200 Subject: [PATCH 46/48] more verbose --- script/cibuild-gh-ost-replica-tests | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/script/cibuild-gh-ost-replica-tests b/script/cibuild-gh-ost-replica-tests index 3cf43f6..cc19e77 100755 --- a/script/cibuild-gh-ost-replica-tests +++ b/script/cibuild-gh-ost-replica-tests @@ -8,6 +8,10 @@ whoami # Only clone if not already running locally at latest commit remote_commit=$(git ls-remote https://github.com/github/gh-ost-ci-env.git HEAD | cut -f1) local_commit=$(cd gh-ost-ci-env && git log --format="%H" -n 1) + +echo "remote commit is $remote_commit" +echo "local commit is $local_commit" + if [ "$remote_commit" != "$local_commit" ] ; then rm -rf ./gh-ost-ci-env git clone https://github.com/github/gh-ost-ci-env.git From 6c1d502516ba95fce978d4eaf61f92c6b0dfdc29 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Tue, 27 Feb 2018 13:40:46 +0200 Subject: [PATCH 47/48] sanity --- script/cibuild-gh-ost-replica-tests | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script/cibuild-gh-ost-replica-tests b/script/cibuild-gh-ost-replica-tests index cc19e77..29e9a8a 100755 --- a/script/cibuild-gh-ost-replica-tests +++ b/script/cibuild-gh-ost-replica-tests @@ -7,7 +7,8 @@ whoami # Clone gh-ost-ci-env # Only clone if not already running locally at latest commit remote_commit=$(git ls-remote https://github.com/github/gh-ost-ci-env.git HEAD | cut -f1) -local_commit=$(cd gh-ost-ci-env && git log --format="%H" -n 1) +local_commit="unknown" +[ -d "gh-ost-ci-env" ] && local_commit=$(cd gh-ost-ci-env && git log --format="%H" -n 1) echo "remote commit is $remote_commit" echo "local commit is $local_commit" From 994304d914d260ed56ecd9c05c4577e9658c6931 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Tue, 27 Feb 2018 13:41:54 +0200 Subject: [PATCH 48/48] text align --- script/cibuild-gh-ost-replica-tests | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/cibuild-gh-ost-replica-tests b/script/cibuild-gh-ost-replica-tests index 29e9a8a..ab8c689 100755 --- a/script/cibuild-gh-ost-replica-tests +++ b/script/cibuild-gh-ost-replica-tests @@ -10,8 +10,8 @@ remote_commit=$(git ls-remote https://github.com/github/gh-ost-ci-env.git HEAD | local_commit="unknown" [ -d "gh-ost-ci-env" ] && local_commit=$(cd gh-ost-ci-env && git log --format="%H" -n 1) -echo "remote commit is $remote_commit" -echo "local commit is $local_commit" +echo "remote commit is: $remote_commit" +echo "local commit is: $local_commit" if [ "$remote_commit" != "$local_commit" ] ; then rm -rf ./gh-ost-ci-env