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
binlog, relay: support binlog sequence number larger than 999999 #1476
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
9480f1f
binlog, relay: support binlog sequence number larger than 999999
lance6716 3332159
fix test
lance6716 71a186a
try add test by GtiHub actions
lance6716 c4c9bb3
try fix CI
lance6716 2358aab
rename
lance6716 9c1c300
fix mount local path
lance6716 ede9a65
use 127.0.0.1:3306
lance6716 d0aa2ac
fix wrong path
lance6716 2607d34
Merge branch 'master' into binlog-999999
GMHDBJD af99c39
Merge branch 'master' into binlog-999999
GMHDBJD 526878f
address comments
lance6716 fe814d4
Merge branch 'binlog-999999' of github.com:lance6716/dm into binlog-9…
lance6716 9fff114
Merge branch 'master' into binlog-999999
lance6716 d963573
Merge branch 'master' into binlog-999999
GMHDBJD fdbd5bf
Merge branch 'master' into binlog-999999
lance6716 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will the pr merged to go-mysql?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/siddontang/go-mysql is not maintained now. maybe we could give a hand after finishing our works 😂