-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drainer: fix placement policy compatibility (#1119)
close #1118, close pingcap/tidb#31611
- Loading branch information
Showing
5 changed files
with
60 additions
and
8 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 |
---|---|---|
|
@@ -22,6 +22,7 @@ _testmain.go | |
*.exe | ||
*.test | ||
*.prof | ||
*.log | ||
|
||
bin | ||
*.iml | ||
|
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,17 @@ | ||
data-dir = '/tmp/tidb_binlog_test/data.drainer' | ||
|
||
[syncer] | ||
txn-batch = 1 | ||
worker-count = 1 | ||
safe-mode = false | ||
db-type = 'mysql' | ||
replicate-do-db = ['placement_test'] | ||
|
||
[syncer.to] | ||
host = '127.0.0.1' | ||
user = 'root' | ||
password = '' | ||
port = 3306 | ||
|
||
[syncer.to.checkpoint] | ||
schema = "placement_rules_checkpoint" |
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,28 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
cd "$(dirname "$0")" | ||
|
||
run_drainer & | ||
|
||
sleep 3 | ||
|
||
run_sql 'CREATE DATABASE placement_test;' | ||
run_sql 'CREATE PLACEMENT POLICY x1 FOLLOWERS=4' | ||
run_sql 'CREATE TABLE placement_test.t1 (a INT NOT NULL PRIMARY KEY, b VARCHAR(100)) PLACEMENT POLICY=x1;' | ||
run_sql "INSERT INTO placement_test.t1 (a,b) VALUES(1,'a'),(2,'b'),(3,'c'),(4,'d');" | ||
run_sql "INSERT INTO placement_test.t1 (a,b) VALUES(5,'e'),(6,'f'),(7,'g'),(8,'h');" | ||
down_run_sql 'CREATE PLACEMENT POLICY x1 FOLLOWERS=4' | ||
|
||
sleep 3 | ||
|
||
down_run_sql 'SELECT a, b FROM placement_test.t1 order by a' | ||
check_contains 'a: 7' | ||
check_contains 'b: g' | ||
check_contains 'a: 8' | ||
check_contains 'b: h' | ||
|
||
run_sql 'DROP DATABASE placement_test' | ||
|
||
killall drainer |