Repository: pingcap/tiflow
Pull request #4999 (2022-03-23 09:20:30)

pipeline(ticdc): enable table actor by default
<!--
Thank you for contributing to TiDB-CDC! Please read MD's [CONTRIBUTING](https://github.com/pingcap/tidb-cdc/blob/master/CONTRIBUTING.md) document **BEFORE** filing this PR.
-->

### What problem does this PR solve?
<!--
Please create an issue first to describe the problem.

There MUST be one line starting with "Issue Number:  " and 
linking the relevant issues via the "close" or "ref".

For more info, check https://pingcap.github.io/tidb-dev-guide/contribute-to-tidb/contribute-code.html#referring-to-an-issue.
 -->

Issue Number: ref https://github.com/pingcap/tiflow/issues/3881

### What is changed and how it works?
enable table actor by default


### Check List <!--REMOVE the items that are not applicable-->

Tests <!-- At least one of them must be included. -->

 - Unit test
 - Integration test



### Release note <!-- bugfixes or new feature need a release note -->

```release-note
enable table actor by default
```


ti-chi-bot: [REVIEW NOTIFICATION]

This pull request has not been approved.


To complete the [pull request process](https://book.prow.tidb.io/#/en/workflows/pr), please ask the reviewers in the [list](https://prow.tidb.io/tichi/repos/pingcap/tiflow/pulls/4999/owners) to review by filling `/cc @reviewer` in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the [list](https://prow.tidb.io/tichi/repos/pingcap/tiflow/pulls/4999/owners) by filling  `/assign @committer` in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found [here](https://prow.tidb.io/command-help?repo=pingcap%2Ftiflow).

<details>

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.
</details>

<!--Review Notification Identifier-->
sdojjy: /run-all-tests
sdojjy: /run-all-tests
sdojjy: /run-all-tests
sdojjy: /run-integration-tests
codecov-commenter: # [Codecov](https://codecov.io/gh/pingcap/tiflow/pull/4999?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) Report
> Merging [#4999](https://codecov.io/gh/pingcap/tiflow/pull/4999?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) (9929010) into [master](https://codecov.io/gh/pingcap/tiflow/commit/687e2486c89a2a7f20bdb1db5ca37e8a777537f4?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) (687e248) will **decrease** coverage by `0.4511%`.
> The diff coverage is `52.2887%`.


| Flag | Coverage Δ | |
|---|---|---|
| cdc | `61.1446% <44.4565%> (+0.5460%)` | :arrow_up: |
| dm | `51.3193% <85.6481%> (-1.1502%)` | :arrow_down: |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap#carryforward-flags-in-the-pull-request-comment) to find out more.

```diff
@@               Coverage Diff                @@
##             master      #4999        +/-   ##
================================================
- Coverage   56.1240%   55.6728%   -0.4512%     
================================================
  Files           522        524         +2     
  Lines         65325      67232      +1907     
================================================
+ Hits          36663      37430       +767     
- Misses        25094      26099      +1005     
- Partials       3568       3703       +135     
```

sdojjy: > tiflow/cdc/processor/pipeline/sorter.go

If table actor is not enable, it will be called by nodeRunner https://github.com/pingcap/tiflow/blob/3a5cbcb0de4cfc5f47194cb03d5903c27403d206/pkg/pipeline/runner.go#L58

```
func (r *nodeRunner) run(ctx context.Context) error {
	nodeCtx := NewNodeContext(ctx, Message{}, r.outputCh)
	defer close(r.outputCh)
	defer func() {
		err := r.node.Destroy(nodeCtx)
		if err != nil && errors.Cause(err) != stdContext.Canceled {
			log.Error("found an error when stopping node",
				zap.String("node", r.name), zap.Error(err))
		}
	}()
	err := r.node.Init(nodeCtx)
	if err != nil {
		return err
	}
```

sdojjy: /run-leak-test
overvenus: /merge
ti-chi-bot: This pull request has been accepted and is ready to merge. <details>Commit hash: d86696d200b7beccd5720cc2b45e7a9715013570</details>
ti-chi-bot: @sdojjy: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.


<details>

Instructions for interacting with me using PR comments are available [here](https://prow.tidb.io/command-help).  If you have questions or suggestions related to my behavior, please file an issue against the [ti-community-infra/tichi](https://github.com/ti-community-infra/tichi/issues/new?title=Prow%20issue:) repository.
</details>

Patch:
diff --git a/pkg/config/debug.go b/pkg/config/debug.go
index c8785eec4..55849a56a 100644
--- a/pkg/config/debug.go
+++ b/pkg/config/debug.go
@@ -18,7 +18,6 @@ import "github.com/pingcap/errors"
 // DebugConfig represents config for ticdc unexposed feature configurations
 type DebugConfig struct {
 	// identify if the table actor is enabled for table pipeline
-	// TODO: turn on after GA.
 	EnableTableActor bool              `toml:"enable-table-actor" json:"enable-table-actor"`
 	TableActor       *TableActorConfig `toml:"table-actor" json:"table-actor"`
 
diff --git a/pkg/config/server_config.go b/pkg/config/server_config.go
index fcd2e3141..a0cb01d15 100644
--- a/pkg/config/server_config.go
+++ b/pkg/config/server_config.go
@@ -98,7 +98,7 @@ var defaultServerConfig = &ServerConfig{
 		RegionScanLimit:  40,
 	},
 	Debug: &DebugConfig{
-		EnableTableActor: false,
+		EnableTableActor: true,
 		TableActor: &TableActorConfig{
 			EventBatchSize: 32,
 		},


Test patch:
diff --git a/pkg/cmd/server/server_test.go b/pkg/cmd/server/server_test.go
index 7aaa5f679..3e54f7392 100644
--- a/pkg/cmd/server/server_test.go
+++ b/pkg/cmd/server/server_test.go
@@ -175,7 +175,7 @@ func TestParseCfg(t *testing.T) {
 			RegionScanLimit:  40,
 		},
 		Debug: &config.DebugConfig{
-			EnableTableActor: false,
+			EnableTableActor: true,
 			TableActor: &config.TableActorConfig{
 				EventBatchSize: 32,
 			},
@@ -318,7 +318,7 @@ server-worker-pool-size = 16
 			RegionScanLimit:  40,
 		},
 		Debug: &config.DebugConfig{
-			EnableTableActor: false,
+			EnableTableActor: true,
 			TableActor: &config.TableActorConfig{
 				EventBatchSize: 32,
 			},
@@ -459,7 +459,7 @@ cert-allowed-cn = ["dd","ee"]
 			RegionScanLimit:  40,
 		},
 		Debug: &config.DebugConfig{
-			EnableTableActor: false,
+			EnableTableActor: true,
 			TableActor: &config.TableActorConfig{
 				EventBatchSize: 32,
 			},
@@ -519,7 +519,7 @@ unknown3 = 3
 	err = o.validate()
 	require.Nil(t, err)
 	require.Equal(t, &config.DebugConfig{
-		EnableTableActor: false,
+		EnableTableActor: true,
 		TableActor: &config.TableActorConfig{
 			EventBatchSize: 32,
 		},
diff --git a/pkg/config/config_test_data.go b/pkg/config/config_test_data.go
index 78cac8a84..15775cad1 100644
--- a/pkg/config/config_test_data.go
+++ b/pkg/config/config_test_data.go
@@ -108,7 +108,7 @@ const (
     "region-scan-limit": 40
   },
   "debug": {
-    "enable-table-actor": false,
+    "enable-table-actor": true,
     "table-actor": {
       "event-batch-size": 32
     },