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

dm: fix MariaDB up down test #11750

Merged
merged 13 commits into from
Dec 26, 2024
1 change: 1 addition & 0 deletions .github/workflows/dm_mariadb_master_down_and_up.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- test-*
- master
schedule:
- cron: '0 17-23 * * *' # run at minute 0 every hour from 01:00 ~ 07:00 UTC+8
workflow_dispatch:
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/dm_upstream_switch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ jobs:

- name: Setup containers
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
docker-compose -f ./dm/tests/upstream_switch/docker-compose.yml up -d

- name: Run test cases
Expand All @@ -73,12 +75,14 @@ jobs:
path: |
./logs

# send Slack notify if failed.
# NOTE: With the exception of `GITHUB_TOKEN`, secrets are not passed to the runner when a workflow is triggered from a forked repository.
- name: Slack notification
# Send feishu notification if failed.
- name: Feishu notification
continue-on-error: true
uses: foxundermoon/feishu-action@v2
if: ${{ failure() }}
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_NOTIFY }}
uses: Ilshidur/[email protected]
with:
args: "upstream-switch job failed, see https://github.com/pingcap/tiflow/actions/runs/{{ GITHUB_RUN_ID }}"
url: ${{ secrets.ENGINE_FEISHU_NOTIFY_URL }}
msg_type: text
content: |
text: |
dm upstream switch job failed, see https://github.com/pingcap/tiflow/actions/runs/${{ github.run_id }}
16 changes: 14 additions & 2 deletions dm/pkg/dumpling/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,20 @@ Finished dump at: 2020-09-30 12:16:49
}
}

noBinlogLoc := `Started dump at: 2020-12-02 17:13:56
Finished dump at: 2020-12-02 17:13:56
noBinlogLoc := `Started dump at: 2024-11-18 12:52:52
SHOW BINARY LOG STATUS:
Log: mysql-bin.000001
Pos: 16127
GTID:0-1-7331

SHOW SLAVE STATUS:
Connection name:
Host: mariadb_master
Log: mysql-bin.000005
Pos: 16544
GTID:

Finished dump at: 2024-11-18 12:52:52
`
err = os.WriteFile(f.Name(), []byte(noBinlogLoc), 0o644)
require.NoError(t, err)
Expand Down
4 changes: 2 additions & 2 deletions dm/tests/mariadb_master_down_and_up/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ x-node: &default-node
services:
mariadb_master:
<<: *default-node
image: mariadb:10.1
image: mariadb:10.0
command: --log-bin=/var/lib/mysql/mysql-bin --log_slave_updates=ON --server-id=1 --gtid_domain_id=0 --binlog-format=ROW
container_name: mariadb_master
hostname: mariadb_master
Expand All @@ -26,7 +26,7 @@ services:

mariadb_slave:
<<: *default-node
image: mariadb:10.1
image: mariadb:10.0
command: --log-bin=/var/lib/mysql/mysql-bin --log_slave_updates=ON --server-id=2 --gtid_domain_id=0 --binlog-format=ROW
container_name: mariadb_slave
hostname: mariadb_slave
Expand Down
Loading