diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 24135734..52a5f38b 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -6,7 +6,7 @@ agents: steps: - name: "Upgrade Test" command: - - apk add g++ make bash curl mysql mysql-client + - apk add g++ make bash gcompat curl mysql mysql-client - wget https://golang.org/dl/go1.19.4.linux-amd64.tar.gz - tar -C /usr/local -xzf go1.19.4.linux-amd64.tar.gz - export PATH=$PATH:/usr/local/go/bin @@ -24,7 +24,7 @@ steps: - name: "Backup Restore Test" command: - - apk add g++ make bash curl mysql mysql-client + - apk add g++ make bash gcompat curl mysql mysql-client - wget https://golang.org/dl/go1.19.4.linux-amd64.tar.gz - tar -C /usr/local -xzf go1.19.4.linux-amd64.tar.gz - export PATH=$PATH:/usr/local/go/bin @@ -42,7 +42,7 @@ steps: - name: "VTOrc and VTAdmin Test" command: - - apk add g++ make bash curl mysql mysql-client chromium + - apk add g++ make bash gcompat curl mysql mysql-client chromium - wget https://golang.org/dl/go1.19.4.linux-amd64.tar.gz - tar -C /usr/local -xzf go1.19.4.linux-amd64.tar.gz - export PATH=$PATH:/usr/local/go/bin diff --git a/deploy/example.yaml b/deploy/example.yaml index fc736083..3cc4d674 100644 --- a/deploy/example.yaml +++ b/deploy/example.yaml @@ -126,6 +126,13 @@ stringData: # Equivalent of mysql_secure_installation ############################################################################### + # We need to ensure that super_read_only is disabled so that we can execute + # these commands. Note that disabling it does NOT disable read_only. + # We save the current value so that we only re-enable it at the end if it was + # enabled before. + SET @original_super_read_only=IF(@@global.super_read_only=1, 'ON', 'OFF'); + SET GLOBAL super_read_only='OFF'; + # Changes during the init db should not make it to the binlog. # They could potentially create errant transactions on replicas. SET sql_log_bin = 0; @@ -202,3 +209,6 @@ stringData: RESET SLAVE ALL; RESET MASTER; + + # We need to set super_read_only back to what it was before + SET GLOBAL super_read_only=IFNULL(@original_super_read_only, 'ON'); \ No newline at end of file diff --git a/pkg/controller/vitesscluster/reconcile_vtadmin.go b/pkg/controller/vitesscluster/reconcile_vtadmin.go index 98132861..f458c327 100644 --- a/pkg/controller/vitesscluster/reconcile_vtadmin.go +++ b/pkg/controller/vitesscluster/reconcile_vtadmin.go @@ -347,7 +347,13 @@ func (r *ReconcileVitessCluster) createWebConfigSecret(ctx context.Context, vt * 'VITE_BUGSNAG_API_KEY': "", 'VITE_DOCUMENT_TITLE': "", 'VITE_READONLY_MODE': %s, - };`, apiAddress, convertReadOnlyFieldToString(vt.Spec.VtAdmin.ReadOnly)) + 'REACT_APP_VTADMIN_API_ADDRESS': "%s", + 'REACT_APP_FETCH_CREDENTIALS': "omit", + 'REACT_APP_ENABLE_EXPERIMENTAL_TABLET_DEBUG_VARS': false, + 'REACT_APP_BUGSNAG_API_KEY': "", + 'REACT_APP_DOCUMENT_TITLE': "", + 'REACT_APP_READONLY_MODE': %s, + };`, apiAddress, convertReadOnlyFieldToString(vt.Spec.VtAdmin.ReadOnly), apiAddress, convertReadOnlyFieldToString(vt.Spec.VtAdmin.ReadOnly)) secretName := vtadmin.WebConfigSecretName(vt.Name, cell.Name) // Create or update the secret diff --git a/runrunrun.sh b/runrunrun.sh new file mode 100644 index 00000000..e556c9a9 --- /dev/null +++ b/runrunrun.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +for i in {1..500} ; do + docker run -it --rm --init --volume $PWD:/workdir --env BUILDKITE_BUILD_ID=$i --volume /var/run/docker.sock:/var/run/docker.sock --workdir /workdir docker:23.0.0 /bin/sh -e -c $'apk add g++ make bash gcompat curl mysql mysql-client\nwget https://golang.org/dl/go1.19.4.linux-amd64.tar.gz\ntar -C /usr/local -xzf go1.19.4.linux-amd64.tar.gz\nrm go1.19.4.linux-amd64.tar.gz\nexport PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/bin:/usr/local/go/bin && make upgrade-test' + if [ $? -eq 0 ]; then + echo "Attempt #$i success" >> runrunrun_log.txt + docker container stop kind-$i-control-plane + docker container rm kind-$i-control-plane + else + echo "========================" >> runrunrun_log.txt + echo "Attempt #$i failed" >> runrunrun_log.txt + fi +done + diff --git a/test/endtoend/operator/101_initial_cluster.yaml b/test/endtoend/operator/101_initial_cluster.yaml index e633a76e..d89ad9e3 100644 --- a/test/endtoend/operator/101_initial_cluster.yaml +++ b/test/endtoend/operator/101_initial_cluster.yaml @@ -80,7 +80,7 @@ spec: mysqld: resources: limits: - memory: 512Mi + memory: 1024Mi requests: cpu: 100m memory: 512Mi @@ -113,6 +113,13 @@ stringData: # Equivalent of mysql_secure_installation ############################################################################### + # We need to ensure that super_read_only is disabled so that we can execute + # these commands. Note that disabling it does NOT disable read_only. + # We save the current value so that we only re-enable it at the end if it was + # enabled before. + SET @original_super_read_only=IF(@@global.super_read_only=1, 'ON', 'OFF'); + SET GLOBAL super_read_only='OFF'; + # Changes during the init db should not make it to the binlog. # They could potentially create errant transactions on replicas. SET sql_log_bin = 0; @@ -197,3 +204,6 @@ stringData: RESET SLAVE ALL; RESET MASTER; + + # We need to set super_read_only back to what it was before + SET GLOBAL super_read_only=IFNULL(@original_super_read_only, 'ON'); \ No newline at end of file diff --git a/test/endtoend/operator/101_initial_cluster_backup.yaml b/test/endtoend/operator/101_initial_cluster_backup.yaml index d8f1be32..51059ed5 100644 --- a/test/endtoend/operator/101_initial_cluster_backup.yaml +++ b/test/endtoend/operator/101_initial_cluster_backup.yaml @@ -87,7 +87,7 @@ spec: mysqld: resources: limits: - memory: 512Mi + memory: 1024Mi requests: cpu: 100m memory: 512Mi @@ -120,6 +120,13 @@ stringData: # Equivalent of mysql_secure_installation ############################################################################### + # We need to ensure that super_read_only is disabled so that we can execute + # these commands. Note that disabling it does NOT disable read_only. + # We save the current value so that we only re-enable it at the end if it was + # enabled before. + SET @original_super_read_only=IF(@@global.super_read_only=1, 'ON', 'OFF'); + SET GLOBAL super_read_only='OFF'; + # Changes during the init db should not make it to the binlog. # They could potentially create errant transactions on replicas. SET sql_log_bin = 0; @@ -204,3 +211,6 @@ stringData: RESET SLAVE ALL; RESET MASTER; + + # We need to set super_read_only back to what it was before + SET GLOBAL super_read_only=IFNULL(@original_super_read_only, 'ON'); \ No newline at end of file diff --git a/test/endtoend/operator/101_initial_cluster_vtorc_vtadmin.yaml b/test/endtoend/operator/101_initial_cluster_vtorc_vtadmin.yaml index b2da4006..0ddcfcca 100644 --- a/test/endtoend/operator/101_initial_cluster_vtorc_vtadmin.yaml +++ b/test/endtoend/operator/101_initial_cluster_vtorc_vtadmin.yaml @@ -95,7 +95,7 @@ spec: mysqld: resources: limits: - memory: 512Mi + memory: 1024Mi requests: cpu: 100m memory: 512Mi @@ -128,6 +128,13 @@ stringData: # Equivalent of mysql_secure_installation ############################################################################### + # We need to ensure that super_read_only is disabled so that we can execute + # these commands. Note that disabling it does NOT disable read_only. + # We save the current value so that we only re-enable it at the end if it was + # enabled before. + SET @original_super_read_only=IF(@@global.super_read_only=1, 'ON', 'OFF'); + SET GLOBAL super_read_only='OFF'; + # Changes during the init db should not make it to the binlog. # They could potentially create errant transactions on replicas. SET sql_log_bin = 0; @@ -212,6 +219,9 @@ stringData: RESET SLAVE ALL; RESET MASTER; + + # We need to set super_read_only back to what it was before + SET GLOBAL super_read_only=IFNULL(@original_super_read_only, 'ON'); rbac.yaml: | rules: - resource: "*" diff --git a/test/endtoend/operator/201_customer_tablets.yaml b/test/endtoend/operator/201_customer_tablets.yaml index e3087512..2a094146 100644 --- a/test/endtoend/operator/201_customer_tablets.yaml +++ b/test/endtoend/operator/201_customer_tablets.yaml @@ -76,7 +76,7 @@ spec: mysqld: resources: limits: - memory: 512Mi + memory: 1024Mi requests: cpu: 100m memory: 512Mi @@ -120,7 +120,7 @@ spec: mysqld: resources: limits: - memory: 512Mi + memory: 1024Mi requests: cpu: 100m memory: 512Mi diff --git a/test/endtoend/operator/302_new_shards.yaml b/test/endtoend/operator/302_new_shards.yaml index 965189dc..9e608903 100644 --- a/test/endtoend/operator/302_new_shards.yaml +++ b/test/endtoend/operator/302_new_shards.yaml @@ -76,7 +76,7 @@ spec: mysqld: resources: limits: - memory: 512Mi + memory: 1024Mi requests: cpu: 100m memory: 512Mi @@ -120,7 +120,7 @@ spec: mysqld: resources: limits: - memory: 512Mi + memory: 1024Mi requests: cpu: 100m memory: 512Mi @@ -151,7 +151,7 @@ spec: mysqld: resources: limits: - memory: 512Mi + memory: 1024Mi requests: cpu: 100m memory: 512Mi diff --git a/test/endtoend/operator/cluster_upgrade.yaml b/test/endtoend/operator/cluster_upgrade.yaml index 65d66c4e..113dcffd 100644 --- a/test/endtoend/operator/cluster_upgrade.yaml +++ b/test/endtoend/operator/cluster_upgrade.yaml @@ -80,7 +80,7 @@ spec: mysqld: resources: limits: - memory: 512Mi + memory: 1024Mi requests: cpu: 100m memory: 512Mi