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

test: fix tso query #724

Merged
merged 1 commit into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/integration_tests/changefeed_auto_stop/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function run() {
rm -rf $WORK_DIR && mkdir -p $WORK_DIR
start_tidb_cluster --workdir $WORK_DIR
cd $WORK_DIR
start_ts=$(cdc cli tso query --pd=http://$UP_PD_HOST_1:$UP_PD_PORT_1)
start_ts=$(run_cdc_cli_tso_query --pd=http://$UP_PD_HOST_1:$UP_PD_PORT_1)

for i in $(seq $DB_COUNT); do
db="changefeed_auto_stop_$i"
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/changefeed_finish/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function run() {
esac

run_cdc_server --workdir $WORK_DIR --binary $CDC_BINARY --addr "127.0.0.1:8300" --pd $pd_addr
now=$(cdc cli tso query --pd=http://$UP_PD_HOST_1:$UP_PD_PORT_1)
now=$(run_cdc_cli_tso_query $UP_PD_HOST_1 $UP_PD_PORT_1)
# 90s after now
target_ts=$(($now + 90 * 10 ** 3 * 2 ** 18))
changefeed_id=$(cdc cli changefeed create --sink-uri="$SINK_URI" --target-ts=$target_ts 2>&1 | tail -n2 | head -n1 | awk '{print $2}')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function resume_changefeed_in_stopped_state() {
run_cdc_server --workdir $WORK_DIR --binary $CDC_BINARY --addr "127.0.0.1:8300" --pd $pd_addr
changefeed_id=$(cdc cli changefeed create --pd=$pd_addr --sink-uri="$SINK_URI" 2>&1 | tail -n2 | head -n1 | awk '{print $2}')

checkpointTs1=$(cdc cli tso query --pd=http://$UP_PD_HOST_1:$UP_PD_PORT_1)
checkpointTs1=$(run_cdc_cli_tso_query $UP_PD_HOST_1 $UP_PD_PORT_1)
for i in $(seq 1 2); do
stmt="create table test.table$i (id int primary key auto_increment, time datetime DEFAULT CURRENT_TIMESTAMP)"
run_sql "$stmt" ${UP_TIDB_HOST} ${UP_TIDB_PORT}
Expand All @@ -36,14 +36,14 @@ function resume_changefeed_in_stopped_state() {
check_sync_diff $WORK_DIR $CUR/conf/diff_config2.toml
cdc cli changefeed pause --changefeed-id=$changefeed_id --pd=$pd_addr

checkpointTs2=$(cdc cli tso query --pd=http://$UP_PD_HOST_1:$UP_PD_PORT_1)
checkpointTs2=$(run_cdc_cli_tso_query $UP_PD_HOST_1 $UP_PD_PORT_1)
for i in $(seq 3 4); do
stmt="CREATE table test.table$i (id int primary key auto_increment, time datetime DEFAULT CURRENT_TIMESTAMP)"
run_sql "$stmt" ${UP_TIDB_HOST} ${UP_TIDB_PORT}
stmt="insert into test.table$i values (),(),(),(),()"
run_sql "$stmt" ${UP_TIDB_HOST} ${UP_TIDB_PORT}
done
checkpointTs3=$(cdc cli tso query --pd=http://$UP_PD_HOST_1:$UP_PD_PORT_1)
checkpointTs3=$(run_cdc_cli_tso_query $UP_PD_HOST_1 $UP_PD_PORT_1)
for i in $(seq 5 6); do
stmt="CREATE table test.table$i (id int primary key auto_increment, time datetime DEFAULT CURRENT_TIMESTAMP)"
run_sql "$stmt" ${UP_TIDB_HOST} ${UP_TIDB_PORT}
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/charset_gbk/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function run() {
cd $WORK_DIR

# record tso before we create tables to skip the system table DDLs
start_ts=$(cdc cli tso query --pd=http://$UP_PD_HOST_1:$UP_PD_PORT_1 | grep -E "^[0-9]+" | awk '{print $1}')
start_ts=$(run_cdc_cli_tso_query $UP_PD_HOST_1 $UP_PD_PORT_1)

run_cdc_server --workdir $WORK_DIR --binary $CDC_BINARY

Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/cli_tls_with_auth/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ EOF
echo "y" | run_cdc_cli unsafe delete-service-gc-safepoint
run_cdc_cli unsafe reset --no-confirm --pd=$pd_addr
REGION_ID=$(pd-ctl --cacert="${TLS_DIR}/ca.pem" --cert="${TLS_DIR}/client.pem" --key="${TLS_DIR}/client-key.pem" -u=$pd_addr region | jq '.regions[0].id')
TS=$(cdc cli tso query --pd=$pd_addr)
TS=$(run_cdc_cli_tso_query $TLS_PD_HOST $TLS_PD_PORT true)
# wait for owner online
sleep 3
run_cdc_cli unsafe resolve-lock --region=$REGION_ID
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/clustered_index/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function run() {
cd $WORK_DIR

# record tso before we create tables to skip the system table DDLs
start_ts=$(cdc cli tso query --pd=http://$UP_PD_HOST_1:$UP_PD_PORT_1)
start_ts=$(run_cdc_cli_tso_query $UP_PD_HOST_1 $UP_PD_PORT_1)

run_cdc_server --workdir $WORK_DIR --binary $CDC_BINARY

Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/consistent_replicate_gbk/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function run() {

storage_path="s3://logbucket/test-changefeed?endpoint=http://127.0.0.1:24927/"
tmp_download_path=$WORK_DIR/cdc_data/redo/$changefeed_id
current_tso=$(cdc cli tso query --pd=http://$UP_PD_HOST_1:$UP_PD_PORT_1)
current_tso=$(run_cdc_cli_tso_query $UP_PD_HOST_1 $UP_PD_PORT_1)
ensure 20 check_redo_resolved_ts $changefeed_id $current_tso $storage_path $tmp_download_path/meta
cleanup_process $CDC_BINARY

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function run() {

storage_path="file://$WORK_DIR/redo"
tmp_download_path=$WORK_DIR/cdc_data/redo/$changefeed_id
current_tso=$(cdc cli tso query --pd=http://$UP_PD_HOST_1:$UP_PD_PORT_1)
current_tso=$(run_cdc_cli_tso_query $UP_PD_HOST_1 $UP_PD_PORT_1)
ensure 50 check_redo_resolved_ts $changefeed_id $current_tso $storage_path $tmp_download_path/meta
cleanup_process $CDC_BINARY

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function run() {

storage_path="file://$WORK_DIR/redo"
tmp_download_path=$WORK_DIR/cdc_data/redo/$changefeed_id
current_tso=$(cdc cli tso query --pd=http://$UP_PD_HOST_1:$UP_PD_PORT_1)
current_tso=$(run_cdc_cli_tso_query $UP_PD_HOST_1 $UP_PD_PORT_1)
ensure 50 check_redo_resolved_ts $changefeed_id $current_tso $storage_path $tmp_download_path/meta
cleanup_process $CDC_BINARY

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function run() {

storage_path="s3://logbucket/test-changefeed?endpoint=http://127.0.0.1:24927/"
tmp_download_path=$WORK_DIR/cdc_data/redo/$changefeed_id
current_tso=$(cdc cli tso query --pd=http://$UP_PD_HOST_1:$UP_PD_PORT_1)
current_tso=$(run_cdc_cli_tso_query $UP_PD_HOST_1 $UP_PD_PORT_1)
ensure 50 check_redo_resolved_ts $changefeed_id $current_tso $storage_path $tmp_download_path/meta
cleanup_process $CDC_BINARY

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function run() {
cd $WORK_DIR

# record tso before we create tables to skip the system table DDLs
start_ts=$(cdc cli tso query --pd=http://$UP_PD_HOST_1:$UP_PD_PORT_1)
start_ts=$(run_cdc_cli_tso_query $UP_PD_HOST_1 $UP_PD_PORT_1)

run_cdc_server --workdir $WORK_DIR --binary $CDC_BINARY

Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/force_replicate_table/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function run() {
cd $WORK_DIR

# record tso before we create tables to skip the system table DDLs
start_ts=$(cdc cli tso query --pd=http://$UP_PD_HOST_1:$UP_PD_PORT_1)
start_ts=$(run_cdc_cli_tso_query $UP_PD_HOST_1 $UP_PD_PORT_1)

run_cdc_server --workdir $WORK_DIR --binary $CDC_BINARY

Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/kafka_big_messages/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function run() {
cd $WORK_DIR

# record tso before we create tables to skip the system table DDLs
start_ts=$(cdc cli tso query --pd=http://$UP_PD_HOST_1:$UP_PD_PORT_1)
start_ts=$(run_cdc_cli_tso_query $UP_PD_HOST_1 $UP_PD_PORT_1)

run_cdc_server --workdir $WORK_DIR --binary $CDC_BINARY

Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/kafka_big_messages_v2/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function run() {
cd $WORK_DIR

# record tso before we create tables to skip the system table DDLs
start_ts=$(cdc cli tso query --pd=http://$UP_PD_HOST_1:$UP_PD_PORT_1)
start_ts=$(run_cdc_cli_tso_query $UP_PD_HOST_1 $UP_PD_PORT_1)

run_cdc_server --workdir $WORK_DIR --binary $CDC_BINARY

Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/kafka_column_selector/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function run() {
cd $WORK_DIR

# record tso before we create tables to skip the system table DDLs
start_ts=$(cdc cli tso query --pd=http://$UP_PD_HOST_1:$UP_PD_PORT_1)
start_ts=$(run_cdc_cli_tso_query $UP_PD_HOST_1 $UP_PD_PORT_1)

run_cdc_server --workdir $WORK_DIR --binary $CDC_BINARY

Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/kafka_column_selector_avro/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function run() {
cd $WORK_DIR

# record tso before we create tables to skip the system table DDLs
start_ts=$(cdc cli tso query --pd=http://$UP_PD_HOST_1:$UP_PD_PORT_1)
start_ts=$(run_cdc_cli_tso_query $UP_PD_HOST_1 $UP_PD_PORT_1)

run_cdc_server --workdir $WORK_DIR --binary $CDC_BINARY

Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/multi_tables_ddl/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function run() {
cd $WORK_DIR

# record tso before we create tables to skip the system table DDLs
start_ts=$(cdc cli tso query --pd=http://$UP_PD_HOST_1:$UP_PD_PORT_1)
start_ts=$(run_cdc_cli_tso_query $UP_PD_HOST_1 $UP_PD_PORT_1)

run_cdc_server --workdir $WORK_DIR --binary $CDC_BINARY

Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/multi_tables_ddl_v2/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function run() {
cd $WORK_DIR

# record tso before we create tables to skip the system table DDLs
start_ts=$(cdc cli tso query --pd=http://$UP_PD_HOST_1:$UP_PD_PORT_1)
start_ts=$(run_cdc_cli_tso_query $UP_PD_HOST_1 $UP_PD_PORT_1)

run_cdc_server --workdir $WORK_DIR --binary $CDC_BINARY

Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/new_ci_collation/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function run() {
cd $WORK_DIR

# record tso before we create tables to skip the system table DDLs
start_ts=$(cdc cli tso query --pd=http://$UP_PD_HOST_1:$UP_PD_PORT_1)
start_ts=$(run_cdc_cli_tso_query $UP_PD_HOST_1 $UP_PD_PORT_1)

run_cdc_server --workdir $WORK_DIR --binary $CDC_BINARY

Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/sequence/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function run() {
cd $WORK_DIR

# record tso before we create tables to skip the system table DDLs
start_ts=$(cdc cli tso query --pd=http://$UP_PD_HOST_1:$UP_PD_PORT_1)
start_ts=$(run_cdc_cli_tso_query $UP_PD_HOST_1 $UP_PD_PORT_1)

run_cdc_server --workdir $WORK_DIR --binary $CDC_BINARY
SINK_URI="mysql://normal:[email protected]:3306/"
Expand Down
Loading