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

Incremental logical backup and point in time recovery #11097

Merged
merged 111 commits into from
Nov 29, 2022
Merged
Show file tree
Hide file tree
Changes from 89 commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
ca8997d
Unexplode Backup() function, pass BackupRequest as argument
shlomi-noach Aug 1, 2022
09a9860
use tabletmanagerdata.BackupRequest
shlomi-noach Aug 1, 2022
2b07269
make proto
shlomi-noach Aug 1, 2022
3eaf01d
removed duplicate tabletmanagerdata imports
shlomi-noach Aug 1, 2022
1914814
tabletmanagerdatapb
shlomi-noach Aug 1, 2022
1513f6c
vschemapb
shlomi-noach Aug 1, 2022
e03a070
require.NoError
shlomi-noach Aug 2, 2022
4d9495e
Merge branch 'main' into unexplode-backup-req
shlomi-noach Aug 2, 2022
123a565
proto: BackupRequest.incremental_from_pos
shlomi-noach Aug 2, 2022
a4fa87f
pass IncrementalFromPos
shlomi-noach Aug 2, 2022
d7b5379
populate incremental_from_pos
shlomi-noach Aug 2, 2022
e0da637
merge main, resolve conflict
shlomi-noach Aug 2, 2022
bc89ea1
Storing ServerUUID and TabletAlias as part of backup MANIFESTO
shlomi-noach Aug 2, 2022
af7e280
use IncrementalFromPos in BackupParams, populate
shlomi-noach Aug 2, 2022
51fc796
executeIncrementalBackup
shlomi-noach Aug 23, 2022
3554a40
merge main, resolve conflict
shlomi-noach Aug 23, 2022
70b4c75
add unit tests for GTID 'Contains'
shlomi-noach Aug 25, 2022
55d7cbc
Add binlog related functions in MySQLDaemon
shlomi-noach Aug 25, 2022
2191d81
More functionality in incremental backup
shlomi-noach Aug 25, 2022
d7b22b1
add backupBinlogDir as a valid backup directory
shlomi-noach Aug 25, 2022
fff13a4
include FromPosition in the backup manifest. Find binlog files to backup
shlomi-noach Aug 25, 2022
fa13cfb
complete incremental backup
shlomi-noach Aug 25, 2022
c4fb1f1
clarify the difference between user's requested position, and the Fro…
shlomi-noach Aug 25, 2022
4f3f85e
Merge branch 'main' into backup-pitr
shlomi-noach Aug 28, 2022
94572cc
make vtadmin_web_proto_types
shlomi-noach Aug 28, 2022
92ed2b1
Add Keyspace, Shard to backup manifest
shlomi-noach Aug 28, 2022
099d8c0
for good order, keyspace comes first
shlomi-noach Aug 28, 2022
b7865ad
take into account purged GTIDs. Fix value of 'incrementalBackupToGTID'
shlomi-noach Aug 29, 2022
52e41ac
endtoend tests for incremental backup. No restore validation as yet. …
shlomi-noach Aug 29, 2022
b80decb
Adding CI shard: 'backup_pitr'
shlomi-noach Aug 29, 2022
9f91009
cleanup
shlomi-noach Aug 29, 2022
a9b9570
backup_pitr tested via mysql80
shlomi-noach Aug 29, 2022
faa0b96
insert data with hint
shlomi-noach Aug 29, 2022
0a4115b
refactor
shlomi-noach Aug 29, 2022
426ad40
FindPITRPath: find a shortest path to recover a GTID position, base o…
shlomi-noach Aug 30, 2022
a4eb4b1
more validation
shlomi-noach Aug 30, 2022
94731b9
more test cases
shlomi-noach Aug 31, 2022
9219316
RestoreFromBackupRequest: RestoreToPos
shlomi-noach Aug 31, 2022
d47e230
vtctl Restore: '--restore_to_pos'
shlomi-noach Aug 31, 2022
84ea435
make vtadmin_web_proto_types
shlomi-noach Aug 31, 2022
c6589c5
Merge branch 'main' into backup-pitr
shlomi-noach Aug 31, 2022
3be3265
RestoreFromBackupRequest: RestoreToPos
shlomi-noach Aug 31, 2022
bb51611
Unexplode: RestoreFromBackup() receives req *tabletmanagerdatapb.Rest…
shlomi-noach Aug 31, 2022
5cd4e80
Unexplode: RestoreFromBackup() receives req *tabletmanagerdatapb.Rest…
shlomi-noach Aug 31, 2022
b0f4ded
make vtadmin_web_proto_types
shlomi-noach Aug 31, 2022
cbafee7
populate restoreParams.RestoreToPos
shlomi-noach Aug 31, 2022
d6e1168
simplifying the logic of finding relevant backup
shlomi-noach Aug 31, 2022
fee1d2e
fix switch/break logic
shlomi-noach Sep 1, 2022
b192f40
towards a restore path
shlomi-noach Sep 1, 2022
5d4f753
Merge branch 'main' into backup-pitr-restore-path
shlomi-noach Sep 1, 2022
6400fab
Merge branch 'main' into backup-pitr
shlomi-noach Sep 1, 2022
78540ce
golang version
shlomi-noach Sep 1, 2022
88b5137
Merge branch 'main' into backup-pitr
shlomi-noach Sep 1, 2022
439649e
fix workflows ubuntu version
shlomi-noach Sep 1, 2022
e6885b4
skip nil manifests
shlomi-noach Sep 1, 2022
cb529fe
FindBackupToRestore() returns a RestorePath, which is an ordered sequ…
shlomi-noach Sep 1, 2022
b304891
Merge branch 'backup-pitr-restore-path' into backup-pitr
shlomi-noach Sep 1, 2022
8e917c8
linter suggestion
shlomi-noach Sep 1, 2022
797c2df
fix backup time comparison logic
shlomi-noach Sep 5, 2022
97304dd
Merge branch 'main' into backup-pitr
shlomi-noach Sep 5, 2022
c8bb5ab
vtctl Restore supports --dry_run flag
shlomi-noach Sep 5, 2022
ab3c251
flag --incremental-from-pos accepts the value 'auto', which takes the…
shlomi-noach Sep 5, 2022
00a7d50
make vtadmin_web_proto_types
shlomi-noach Sep 5, 2022
211b861
endtoend: validate --incremental_from_pos=auto
shlomi-noach Sep 6, 2022
fa40ffb
towards applying binary logs: extracting onto temporary directory
shlomi-noach Sep 7, 2022
91bcc12
apply binary log file
shlomi-noach Sep 18, 2022
2b2ec44
Merge branch 'main' into backup-pitr
shlomi-noach Sep 18, 2022
3a839fc
do not restore replication at end of PITR
shlomi-noach Sep 19, 2022
663ecc0
take dryrun into consideration
shlomi-noach Sep 19, 2022
3cdec5b
testing restore to pos
shlomi-noach Sep 19, 2022
9f3b197
Merge branch 'main' into backup-pitr
shlomi-noach Sep 19, 2022
46a5068
testing restore to pos: wait for replication, avoid bogus writes
shlomi-noach Sep 21, 2022
abda28b
validating PITR path when binary logs are missing history
shlomi-noach Sep 21, 2022
3e1c63d
Merge branch 'main' into backup-pitr
shlomi-noach Sep 21, 2022
4b11151
full backup manifest now includes 'PurgedPosition', which is necessar…
shlomi-noach Sep 21, 2022
d3ca0c5
more recovery paths tests
shlomi-noach Sep 21, 2022
81b1ba3
restrucutre tests
shlomi-noach Sep 21, 2022
3c5d063
Merge branch 'main' into backup-pitr
shlomi-noach Sep 22, 2022
3a121e1
log restore path
shlomi-noach Sep 22, 2022
be0de84
merge main, resolve conflict
shlomi-noach Sep 28, 2022
f06e458
Merge branch 'main' into backup-pitr
shlomi-noach Sep 29, 2022
317b035
merge main, resolve conflict
shlomi-noach Oct 12, 2022
1664df9
generate CI workflows
shlomi-noach Oct 12, 2022
c8fbb8f
code comments
shlomi-noach Oct 12, 2022
914c589
code comments
shlomi-noach Oct 12, 2022
f965b2f
code comments
shlomi-noach Oct 12, 2022
e925b9e
CI 57 and 80
shlomi-noach Oct 13, 2022
37e0020
Merge branch 'main' into backup-pitr
shlomi-noach Oct 13, 2022
a1c54b1
flags test
shlomi-noach Oct 13, 2022
0d99207
copyright year
shlomi-noach Oct 18, 2022
f137e27
merge main, resolve conflict
shlomi-noach Oct 18, 2022
34a5ad9
go version
shlomi-noach Oct 18, 2022
fcfb745
removed legacy mysql80 test
shlomi-noach Oct 18, 2022
e1f7b56
Merge branch 'main' into backup-pitr
shlomi-noach Oct 26, 2022
2ea863c
PITR: stop search for possible resotre path with the first valid path…
shlomi-noach Oct 26, 2022
a99ded1
merge main, resolve conflict
shlomi-noach Nov 2, 2022
2086793
support incrementally union-izing of previous-GTIDs when iterating bi…
shlomi-noach Nov 3, 2022
9efac69
removed local metadata info
shlomi-noach Nov 7, 2022
ba7b9e7
Merge branch 'main' into backup-pitr
shlomi-noach Nov 7, 2022
99d6561
merge main, resolve conflict
shlomi-noach Nov 10, 2022
ec4e14e
Merge branch 'main' into backup-pitr
shlomi-noach Nov 13, 2022
3296463
merged main, regenerated workflows
shlomi-noach Nov 13, 2022
4ab2aee
go mod tidy
shlomi-noach Nov 14, 2022
332c1c1
merge main, resolve conflict
shlomi-noach Nov 20, 2022
f1d0b16
rename conflicting variable
shlomi-noach Nov 22, 2022
68cdb7e
refactor: const value
shlomi-noach Nov 22, 2022
525f4e3
merge main, resolve conflict
shlomi-noach Nov 22, 2022
b8d27fd
Merge branch 'main' into backup-pitr
shlomi-noach Nov 28, 2022
c8685c2
dry run restore now returns with 0 exit code, no error
shlomi-noach Nov 28, 2022
5dd2fe7
Merge branch 'main' into backup-pitr
shlomi-noach Nov 29, 2022
008f2c8
release notes
shlomi-noach Nov 29, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 126 additions & 0 deletions .github/workflows/cluster_endtoend_backup_pitr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
# DO NOT MODIFY: THIS FILE IS GENERATED USING "make generate_ci_workflows"

name: Cluster (backup_pitr)
on: [push, pull_request]
concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (backup_pitr)')
cancel-in-progress: true

env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
GITHUB_PR_HEAD_SHA: "${{ github.event.pull_request.head.sha }}"

jobs:
build:
name: Run endtoend tests on Cluster (backup_pitr)
runs-on: ubuntu-20.04

steps:
- name: Check if workflow needs to be skipped
id: skip-workflow
run: |
skip='false'
if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then
skip='true'
fi
echo Skip ${skip}
echo "::set-output name=skip-workflow::${skip}"

- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v2

- name: Check for changes in relevant files
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: frouioui/paths-filter@main
id: changes
with:
token: ''
filters: |
end_to_end:
- 'go/**/*.go'
- 'test.go'
- 'Makefile'
- 'build.env'
- 'go.[sumod]'
- 'proto/*.proto'
- 'tools/**'
- 'config/**'
- 'bootstrap.sh'
- '.github/workflows/cluster_endtoend_backup_pitr.yml'

- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
uses: actions/setup-go@v2
with:
go-version: 1.18.5

- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
uses: actions/setup-python@v2

- name: Tune the OS
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
run: |
echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range
# Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio
echo "fs.aio-max-nr = 1048576" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p /etc/sysctl.conf

- name: Get dependencies
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
run: |
# Setup Percona Server for MySQL 8.0
sudo apt-get update
sudo apt-get install -y lsb-release gnupg2 curl
wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb
sudo DEBIAN_FRONTEND="noninteractive" dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
sudo percona-release setup ps80
sudo apt-get update

# Install everything else we need, and configure
sudo apt-get install -y percona-server-server percona-server-client make unzip g++ etcd git wget eatmydata xz-utils
sudo service mysql stop
sudo service etcd stop
sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
go mod download

# install JUnit report formatter
go install github.com/vitessio/go-junit-report@HEAD

- name: Setup launchable dependencies
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null

# verify that launchable setup is all correct.
launchable verify || true

# Tell Launchable about the build you are producing and testing
launchable record build --name "$GITHUB_RUN_ID" --source .

- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
timeout-minutes: 45
run: |
# We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file
# which musn't be more than 107 characters long.
export VTDATAROOT="/tmp/"
source build.env

set -x

# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard backup_pitr | tee -a output.txt | go-junit-report -set-exit-code > report.xml

- name: Print test output and Record test result in launchable
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
# send recorded tests to launchable
launchable record tests --build "$GITHUB_RUN_ID" go-test . || true

# print test output
cat output.txt
140 changes: 140 additions & 0 deletions .github/workflows/cluster_endtoend_backup_pitr_mysql57.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
# DO NOT MODIFY: THIS FILE IS GENERATED USING "make generate_ci_workflows"

name: Cluster (backup_pitr) mysql57
on: [push, pull_request]
concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (backup_pitr) mysql57')
cancel-in-progress: true

env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
GITHUB_PR_HEAD_SHA: "${{ github.event.pull_request.head.sha }}"

jobs:
build:
name: Run endtoend tests on Cluster (backup_pitr) mysql57
runs-on: ubuntu-20.04

steps:
- name: Check if workflow needs to be skipped
id: skip-workflow
run: |
skip='false'
if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then
skip='true'
fi
echo Skip ${skip}
echo "::set-output name=skip-workflow::${skip}"

- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v2

- name: Check for changes in relevant files
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: frouioui/paths-filter@main
id: changes
with:
token: ''
filters: |
end_to_end:
- 'go/**/*.go'
- 'test.go'
- 'Makefile'
- 'build.env'
- 'go.[sumod]'
- 'proto/*.proto'
- 'tools/**'
- 'config/**'
- 'bootstrap.sh'
- '.github/workflows/cluster_endtoend_backup_pitr_mysql57.yml'

- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
uses: actions/setup-go@v2
with:
go-version: 1.18.5

- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
uses: actions/setup-python@v2

- name: Tune the OS
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
run: |
echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range
# Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio
echo "fs.aio-max-nr = 1048576" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p /etc/sysctl.conf

- name: Get dependencies
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
run: |
sudo apt-get update

# Uninstall any previously installed MySQL first
sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld

sudo systemctl stop apparmor
sudo DEBIAN_FRONTEND="noninteractive" apt-get remove -y --purge mysql-server mysql-client mysql-common
sudo apt-get -y autoremove
sudo apt-get -y autoclean
sudo deluser mysql
sudo rm -rf /var/lib/mysql
sudo rm -rf /etc/mysql

# Get key to latest MySQL repo
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29

wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.14-1_all.deb
# Bionic packages are still compatible for Focal since there's no MySQL 5.7
# packages for Focal.
echo mysql-apt-config mysql-apt-config/repo-codename select bionic | sudo debconf-set-selections
echo mysql-apt-config mysql-apt-config/select-server select mysql-5.7 | sudo debconf-set-selections
sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config*
sudo apt-get update
sudo DEBIAN_FRONTEND="noninteractive" apt-get install -y mysql-client=5.7* mysql-community-server=5.7* mysql-server=5.7*

sudo apt-get install -y make unzip g++ etcd curl git wget eatmydata
sudo service mysql stop
sudo service etcd stop

# install JUnit report formatter
go install github.com/vitessio/go-junit-report@HEAD

- name: Setup launchable dependencies
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null

# verify that launchable setup is all correct.
launchable verify || true

# Tell Launchable about the build you are producing and testing
launchable record build --name "$GITHUB_RUN_ID" --source .

- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
timeout-minutes: 45
run: |
# We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file
# which musn't be more than 107 characters long.
export VTDATAROOT="/tmp/"
source build.env

set -x

# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard backup_pitr | tee -a output.txt | go-junit-report -set-exit-code > report.xml

- name: Print test output and Record test result in launchable
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
# send recorded tests to launchable
launchable record tests --build "$GITHUB_RUN_ID" go-test . || true

# print test output
cat output.txt
127 changes: 127 additions & 0 deletions .github/workflows/cluster_endtoend_backup_pitr_mysql80.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# DO NOT MODIFY: THIS FILE IS GENERATED USING "make generate_ci_workflows"

name: Cluster (backup_pitr) mysql80
on: [push, pull_request]
concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (backup_pitr) mysql80')
cancel-in-progress: true

env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
GITHUB_PR_HEAD_SHA: "${{ github.event.pull_request.head.sha }}"

jobs:
build:
name: Run endtoend tests on Cluster (backup_pitr) mysql80
runs-on: ubuntu-20.04
timeout-minutes: 45

steps:
- name: Check if workflow needs to be skipped
id: skip-workflow
run: |
skip='false'
if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then
skip='true'
fi
echo Skip ${skip}
echo "::set-output name=skip-workflow::${skip}"

- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v2

- name: Check for changes in relevant files
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: frouioui/paths-filter@main
id: changes
with:
token: ''
filters: |
end_to_end:
- 'go/**/*.go'
- 'test.go'
- 'Makefile'
- 'build.env'
- 'go.[sumod]'
- 'proto/*.proto'
- 'tools/**'
- 'config/**'
- 'bootstrap.sh'
- '.github/workflows/cluster_endtoend_backup_pitr_mysql80.yml'

- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
uses: actions/setup-go@v2
with:
go-version: 1.18.5

- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
uses: actions/setup-python@v2

- name: Tune the OS
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
run: |
echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range
# Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio
echo "fs.aio-max-nr = 1048576" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p /etc/sysctl.conf

- name: Get dependencies
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
run: |
# Setup Percona Server for MySQL 8.0
sudo apt-get update
sudo apt-get install -y lsb-release gnupg2 curl
wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb
sudo DEBIAN_FRONTEND="noninteractive" dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
sudo percona-release setup ps80
sudo apt-get update

# Install everything else we need, and configure
sudo apt-get install -y percona-server-server percona-server-client make unzip g++ etcd git wget eatmydata xz-utils
sudo service mysql stop
sudo service etcd stop
sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
go mod download

# install JUnit report formatter
go install github.com/vitessio/go-junit-report@HEAD

- name: Setup launchable dependencies
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null

# verify that launchable setup is all correct.
launchable verify || true

# Tell Launchable about the build you are producing and testing
launchable record build --name "$GITHUB_RUN_ID" --source .

- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
timeout-minutes: 30
run: |
# We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file
# which musn't be more than 107 characters long.
export VTDATAROOT="/tmp/"
source build.env

set -x

# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard backup_pitr | tee -a output.txt | go-junit-report -set-exit-code > report.xml

- name: Print test output and Record test result in launchable
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
# send recorded tests to launchable
launchable record tests --build "$GITHUB_RUN_ID" go-test . || true

# print test output
cat output.txt
Loading