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 safe mode test #809

Merged
merged 3 commits into from
Jan 8, 2025
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
123 changes: 123 additions & 0 deletions .github/workflows/integration_test_mysql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,135 @@ jobs:
run: |
export TICDC_NEWARCH=true && make integration_test CASE=region_merge

# The 12th case in this group
- name: Test safe mode
if: ${{ success() }}
run: |
export TICDC_NEWARCH=true && make integration_test CASE=safe_mode

# The 13th case in this group
- name: Test savepoint
if: ${{ success() }}
run: |
export TICDC_NEWARCH=true && make integration_test CASE=savepoint

# The 14th case in this group
- name: Test server config compatibility
if: ${{ success() }}
run: |
export TICDC_NEWARCH=true && make integration_test CASE=server_config_compatibility

# The 15th case in this group
- name: Test split region
if: ${{ success() }}
run: |
export TICDC_NEWARCH=true && make integration_test CASE=split_region

- name: Upload test logs
if: always()
uses: ./.github/actions/upload-test-logs
with:
log-name: e2e_test_group_1

e2e_test_group_2:
## Only run ci when PR is not draft
if: github.event.pull_request.draft == false

runs-on: ubuntu-latest
name: E2E Test Group 2
steps:
- name: Check out code
uses: actions/checkout@v2

- name: Setup Go environment
uses: actions/setup-go@v3
with:
go-version: '1.23'

- name: Integration Build
run: |
tests/scripts/download-integration-test-binaries.sh master true
go build -o ./tools/bin/failpoint-ctl github.com/pingcap/failpoint/failpoint-ctl
make integration_test_build
ls -l bin/ && ls -l tools/bin/

- name: Test api_v2
if: ${{ success() }}
run: |
export TICDC_NEWARCH=true && make integration_test CASE=api_v2

- name: Test autorandom
if: ${{ success() }}
run: |
export TICDC_NEWARCH=true && make integration_test CASE=autorandom

- name: Test availability
if: ${{ success() }}
run: |
export TICDC_NEWARCH=true && make integration_test CASE=availability

- name: Test bank
if: ${{ success() }}
run: |
export TICDC_NEWARCH=true && make integration_test CASE=bank

- name: Test batch_add_table
if: ${{ success() }}
run: |
export TICDC_NEWARCH=true && make integration_test CASE=batch_add_table

- name: Test batch_update_to_no_batch
if: ${{ success() }}
run: |
export TICDC_NEWARCH=true && make integration_test CASE=batch_update_to_no_batch

- name: Test ci_collation_compatibility
if: ${{ success() }}
run: |
export TICDC_NEWARCH=true && make integration_test CASE=ci_collation_compatibility

- name: Test multi_capture
if: ${{ success() }}
run: |
export TICDC_NEWARCH=true && make integration_test CASE=multi_capture

- name: Test multi_cdc_cluster
if: ${{ success() }}
run: |
export TICDC_NEWARCH=true && make integration_test CASE=multi_cdc_cluster

- name: Test multi_rocks
if: ${{ success() }}
run: |
export TICDC_NEWARCH=true && make integration_test CASE=multi_rocks

- name: Test resourcecontrol
if: ${{ success() }}
run: |
export TICDC_NEWARCH=true && make integration_test CASE=resourcecontrol

- name: Test row_format
if: ${{ success() }}
run: |
export TICDC_NEWARCH=true && make integration_test CASE=row_format

- name: Test tiflash
if: ${{ success() }}
run: |
export TICDC_NEWARCH=true && make integration_test CASE=tiflash

# The 14th case in this group
- name: Test vector
if: ${{ success() }}
run: |
export TICDC_NEWARCH=true && make integration_test CASE=vector

- name: Upload test logs
if: always()
uses: ./.github/actions/upload-test-logs
with:
log-name: e2e_test_group_2


failover_e2e_test1:
## Only run ci when PR is not draft
Expand Down
15 changes: 14 additions & 1 deletion pkg/sink/mysql/mysql_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,20 @@ func (w *MysqlWriter) prepareDMLs(events []*commonEvent.DMLEvent) (*preparedDMLs

switch row.RowType {
case commonEvent.RowTypeUpdate:
query, args, err = buildUpdate(event.TableInfo, row)
if translateToInsert {
query, args, err = buildUpdate(event.TableInfo, row)
} else {
query, args, err = buildDelete(event.TableInfo, row)
if err != nil {
dmlsPool.Put(dmls) // Return to pool on error
return nil, errors.Trace(err)
}
if query != "" {
dmls.sqls = append(dmls.sqls, query)
dmls.values = append(dmls.values, args)
}
query, args, err = buildInsert(event.TableInfo, row, translateToInsert)
}
case commonEvent.RowTypeDelete:
query, args, err = buildDelete(event.TableInfo, row)
case commonEvent.RowTypeInsert:
Expand Down
Loading