-
Notifications
You must be signed in to change notification settings - Fork 288
145 lines (125 loc) · 5.39 KB
/
dm_binlog_999999.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: DM Binlog 999999
on:
schedule:
- cron: '0 17-23 * * *' # run at minute 0 every hour from 01:00 ~ 07:00 UTC+8
workflow_dispatch:
inputs:
pr:
description: 'Which PR do you want to trigger'
required: true
default: ''
jobs:
test-binlog-999999:
name: Test binlog 999999
runs-on: ubuntu-20.04
services:
docker:
image: docker:19.03.12
options: >-
--privileged
steps:
- name: Set up Go env
uses: actions/setup-go@v3
with:
go-version: '1.23'
- name: Check out code
uses: actions/checkout@v2
- name: Check out code by workflow dispatch
if: ${{ github.event.inputs.pr != '' }}
uses: actions/checkout@v2
with:
ref: refs/pull/${{ github.event.inputs.pr }}/head
- name: Set DOCKER_HOST
run: echo "export DOCKER_HOST=unix:///var/run/docker.sock" >> $GITHUB_ENV
- name: Install docker-compose
run: |
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
- name: Cache go modules
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-ticdc-${{ hashFiles('go.sum') }}
- name: Cache Tools
id: cache-tools
uses: actions/cache@v2
with:
path: tools/bin
key: ${{ runner.os }}-ticdc-tools-${{ hashFiles('tools/check/go.sum') }}
- name: Build DM binary
run: make dm_integration_test_build
- name: Setup CI environment
run: |
sudo apt-get update
sudo apt-get install -y curl
sudo docker-compose -f ./dm/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/
curl -O https://dl.min.io/server/minio/release/linux-amd64/minio
chmod +x minio
mv minio bin/
- name: Change binlog sequence number to 999999
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 ./dm/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 ./dm/tests/binlog_999999/docker-compose.yml up -d
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 "show binary logs;" | mysql -uroot -h127.0.0.1 -P3306 -p123456
echo "show binary logs;" | mysql -uroot -h127.0.0.1 -P3307 -p123456
- name: Run test cases
run: |
RESET_MASTER=false make dm_integration_test CASE=incremental_mode
echo "show binary logs;" | mysql -uroot -h127.0.0.1 -P3306 -p123456
echo "show binary logs;" | mysql -uroot -h127.0.0.1 -P3307 -p123456
echo "show binary logs;" | mysql -uroot -h127.0.0.1 -P3306 -p123456 | grep -q "mysql-bin.1000003"
echo "show binary logs;" | mysql -uroot -h127.0.0.1 -P3307 -p123456 | grep -q "mysql-bin.1000002"
- 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@v4
if: ${{ always() }}
with:
name: test-binlog-999999
path: |
./logs
# Send feishu notification if failed.
- name: Feishu notification
continue-on-error: true
uses: foxundermoon/feishu-action@v2
if: ${{ failure() }}
with:
url: ${{ secrets.ENGINE_FEISHU_NOTIFY_URL }}
msg_type: text
content: |
text: |
binlog 999999 job failed, see https://github.com/pingcap/tiflow/actions/runs/${{ github.run_id }}