From ab80839511aa561e70a192423569f8d2e3e5f893 Mon Sep 17 00:00:00 2001 From: gmhdbjd Date: Thu, 27 Oct 2022 13:49:48 +0800 Subject: [PATCH 1/4] remove concurrency --- .github/workflows/dataflow_engine_chaos.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/dataflow_engine_chaos.yaml b/.github/workflows/dataflow_engine_chaos.yaml index 44e5d21071f..0e9db737251 100644 --- a/.github/workflows/dataflow_engine_chaos.yaml +++ b/.github/workflows/dataflow_engine_chaos.yaml @@ -10,11 +10,6 @@ on: required: true default: '' -# See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency. -concurrency: - group: ${{ github.ref }}-${{ github.workflow }} - cancel-in-progress: true - # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: # This workflow contains a single job called "base" From beedcced24689d1f51bcc5a04ee349ff65aa7ca5 Mon Sep 17 00:00:00 2001 From: gmhdbjd Date: Mon, 19 Jun 2023 16:00:28 +0800 Subject: [PATCH 2/4] return error for conflict error --- dm/syncer/ddl.go | 3 +++ dm/tests/shardddl4_1/run.sh | 11 ++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/dm/syncer/ddl.go b/dm/syncer/ddl.go index b8304c3b036..02e22cea54b 100644 --- a/dm/syncer/ddl.go +++ b/dm/syncer/ddl.go @@ -851,6 +851,9 @@ func (ddl *Optimist) handleDDL(qec *queryEventContext) error { if op.ConflictStage != optimism.ConflictDetected { break } + if ddl.strict { + return terror.ErrSyncerShardDDLConflict.Generate(qec.needHandleDDLs, op.ConflictMsg) + } rev = op.Revision ddl.logger.Info("operation conflict detected, waiting for resolve", zap.Stringer("info", info)) } diff --git a/dm/tests/shardddl4_1/run.sh b/dm/tests/shardddl4_1/run.sh index b7914bf6fae..9e750894144 100644 --- a/dm/tests/shardddl4_1/run.sh +++ b/dm/tests/shardddl4_1/run.sh @@ -1217,13 +1217,14 @@ function DM_STRICT_OPTIMISTIC_SINGLE_SOURCE_CASE() { run_sql_source1 "insert into ${shardddl1}.${tb1} values(1,1);" run_sql_source1 "insert into ${shardddl1}.${tb2} values(2,2);" - run_sql_source1 "alter table ${shardddl1}.${tb1} add c int;" + run_sql_source1 "alter table ${shardddl1}.${tb1} add c int not null default 10;" run_sql_source1 "insert into ${shardddl1}.${tb1} values(3,3,3);" run_sql_source1 "insert into ${shardddl1}.${tb2} values(4,4);" - run_sql_source1 "alter table ${shardddl1}.${tb2} change b c int;" + run_sql_source1 "alter table ${shardddl1}.${tb2} add c varchar(30) not null default '10';" run_dm_ctl_with_retry $WORK_DIR "127.0.0.1:$MASTER_PORT" \ "query-status test" \ + '"stage": "Paused"' 1 \ "because schema conflict detected" 1 } @@ -1258,9 +1259,9 @@ function DM_STRICT_OPTIMISTIC_DOUBLE_SOURCE() { function run() { init_cluster init_database - DM_TABLE_CHECKPOINT_BACKWARD - DM_RESYNC_NOT_FLUSHED - DM_RESYNC_TXN_INTERRUPT + # DM_TABLE_CHECKPOINT_BACKWARD + # DM_RESYNC_NOT_FLUSHED + # DM_RESYNC_TXN_INTERRUPT DM_STRICT_OPTIMISTIC_SINGLE_SOURCE DM_STRICT_OPTIMISTIC_DOUBLE_SOURCE start=131 From 26337aecd8ecf986c74b76b3dd242f5291e1c24d Mon Sep 17 00:00:00 2001 From: gmhdbjd Date: Mon, 19 Jun 2023 16:02:46 +0800 Subject: [PATCH 3/4] Revert "remove concurrency" This reverts commit 0fa5ce148f628194b9c84adcbf5a414b38de1f65. --- .github/workflows/dataflow_engine_chaos.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/dataflow_engine_chaos.yaml b/.github/workflows/dataflow_engine_chaos.yaml index 0e9db737251..44e5d21071f 100644 --- a/.github/workflows/dataflow_engine_chaos.yaml +++ b/.github/workflows/dataflow_engine_chaos.yaml @@ -10,6 +10,11 @@ on: required: true default: '' +# See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency. +concurrency: + group: ${{ github.ref }}-${{ github.workflow }} + cancel-in-progress: true + # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: # This workflow contains a single job called "base" From 0c8894f1ffa5c5e40d7e47324247e79ec0238a62 Mon Sep 17 00:00:00 2001 From: gmhdbjd Date: Mon, 19 Jun 2023 16:03:42 +0800 Subject: [PATCH 4/4] update --- dm/tests/shardddl4_1/run.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dm/tests/shardddl4_1/run.sh b/dm/tests/shardddl4_1/run.sh index 9e750894144..8cac95b6ad2 100644 --- a/dm/tests/shardddl4_1/run.sh +++ b/dm/tests/shardddl4_1/run.sh @@ -1259,9 +1259,9 @@ function DM_STRICT_OPTIMISTIC_DOUBLE_SOURCE() { function run() { init_cluster init_database - # DM_TABLE_CHECKPOINT_BACKWARD - # DM_RESYNC_NOT_FLUSHED - # DM_RESYNC_TXN_INTERRUPT + DM_TABLE_CHECKPOINT_BACKWARD + DM_RESYNC_NOT_FLUSHED + DM_RESYNC_TXN_INTERRUPT DM_STRICT_OPTIMISTIC_SINGLE_SOURCE DM_STRICT_OPTIMISTIC_DOUBLE_SOURCE start=131