This repository has been archived by the owner on Nov 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
9 changed files
with
159 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
name: Test binlog 999999 | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- release-2.0 | ||
pull_request: | ||
branches: | ||
- master | ||
- release-2.0 | ||
|
||
jobs: | ||
test-binlog-999999: | ||
name: Test binlog 999999 | ||
runs-on: ubuntu-18.04 | ||
|
||
steps: | ||
- name: Set up Go 1.13 | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.13 | ||
|
||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Cache go modules | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-dm-${{ hashFiles('**/go.sum') }} | ||
|
||
- name: Cache tools | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
**/tools | ||
key: ${{ runner.os }}-dm-tools-${{ hashFiles('**/tools/go.sum') }} | ||
|
||
- name: Build DM binary | ||
run: make dm_integration_test_build | ||
|
||
- name: Setup CI environment | ||
run: | | ||
docker-compose -f ./tests/binlog_999999/docker-compose.yml up -d | ||
curl http://download.pingcap.org/tidb-enterprise-tools-nightly-linux-amd64.tar.gz | tar xz | ||
mv tidb-enterprise-tools-nightly-linux-amd64/bin/sync_diff_inspector bin/ | ||
curl http://download.pingcap.org/tidb-nightly-linux-amd64.tar.gz | tar xz | ||
mv tidb-nightly-linux-amd64/bin/tidb-server bin/ | ||
- name: change binlog sequence number to 999998 | ||
run: | | ||
while ! mysqladmin -h127.0.0.1 -P3306 -p123456 -uroot ping --connect-timeout=1 > /dev/null 2>&1 ; do | ||
echo "wait mysql" | ||
sleep 1 | ||
done | ||
while ! mysqladmin -h127.0.0.1 -P3307 -p123456 -uroot ping --connect-timeout=1 > /dev/null 2>&1 ; do | ||
echo "wait mysql" | ||
sleep 1 | ||
done | ||
echo "reset master;" | mysql -uroot -h127.0.0.1 -P3306 -p123456 | ||
echo "reset master;" | mysql -uroot -h127.0.0.1 -P3307 -p123456 | ||
docker-compose -f ./tests/binlog_999999/docker-compose.yml down | ||
sudo mv /tmp/mysql1-data/mysql-bin.000001 /tmp/mysql1-data/mysql-bin.999998 | ||
sudo bash -c "echo './mysql-bin.999998' > /tmp/mysql1-data/mysql-bin.index" | ||
sudo mv /tmp/mysql2-data/mysql-bin.000001 /tmp/mysql2-data/mysql-bin.999998 | ||
sudo bash -c "echo './mysql-bin.999998' > /tmp/mysql2-data/mysql-bin.index" | ||
docker-compose -f ./tests/binlog_999999/docker-compose.yml up -d | ||
- name: Run test cases | ||
run: | | ||
RESET_MASTER=false make integration_test CASE=incremental_mode | ||
echo "show binary logs;" | mysql -uroot -h127.0.0.1 -P3306 -p123456 | grep -q "mysql-bin.1000000" | ||
echo "show binary logs;" | mysql -uroot -h127.0.0.1 -P3307 -p123456 | grep -q "mysql-bin.1000000" | ||
- name: Copy logs to hack permission | ||
if: ${{ always() }} | ||
run: | | ||
mkdir ./logs | ||
sudo cp -r -L /tmp/dm_test/incremental_mode/master/log ./logs/master | ||
sudo cp -r -L /tmp/dm_test/incremental_mode/worker1/log ./logs/worker1 | ||
sudo cp -r -L /tmp/dm_test/incremental_mode/worker2/log ./logs/worker2 | ||
sudo chown -R runner ./logs | ||
# Update logs as artifact seems not stable, so we set `continue-on-error: true` here. | ||
- name: Upload logs | ||
continue-on-error: true | ||
uses: actions/upload-artifact@v2 | ||
if: ${{ always() }} | ||
with: | ||
name: test-binlog-999999 | ||
path: | | ||
./logs | ||
# Debug via SSH if previous steps failed | ||
- name: Set up tmate session | ||
if: ${{ failure() }} | ||
uses: mxschmitt/action-tmate@v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
version: "3.7" | ||
|
||
networks: | ||
db-networks: | ||
ipam: # for static IP | ||
config: | ||
- subnet: "172.28.128.0/24" | ||
|
||
# re-usable extension fields, https://docs.docker.com/compose/compose-file/#extension-fields. | ||
x-node: &default-node | ||
privileged: true | ||
restart: always | ||
environment: | ||
MYSQL_ROOT_PASSWORD: "123456" | ||
|
||
services: | ||
mysql1: # upstream MySQL-1 | ||
<<: *default-node | ||
container_name: mysql1 | ||
hostname: mysql1 | ||
ports: | ||
- "3306:3306" | ||
networks: | ||
db-networks: | ||
ipv4_address: 172.28.128.4 | ||
image: mysql:5.7.32 | ||
command: --default-authentication-plugin=mysql_native_password --log-bin=/var/lib/mysql/mysql-bin --server-id=1 --binlog-format=ROW --gtid_mode=ON --enforce-gtid-consistency=true | ||
volumes: | ||
- /tmp/mysql1-data:/var/lib/mysql | ||
|
||
mysql2: # upstream MySQL-2 | ||
<<: *default-node | ||
container_name: mysql2 | ||
hostname: mysql2 | ||
ports: | ||
- "3307:3306" | ||
networks: | ||
db-networks: | ||
ipv4_address: 172.28.128.5 | ||
image: mysql:8.0.23 | ||
command: --default-authentication-plugin=mysql_native_password --log-bin=/var/lib/mysql/mysql-bin --server-id=1 --binlog-format=ROW --gtid_mode=ON --enforce-gtid-consistency=true | ||
volumes: | ||
- /tmp/mysql2-data:/var/lib/mysql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
use incremental_mode; | ||
flush logs; | ||
flush logs; | ||
delete from t2 where name = 'Sansa'; |