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

batch (ticdc): add etcdTxnMaxOps to limit the ops number of an etcd txn #3681

Merged

Conversation

asddongmen
Copy link
Contributor

What problem does this PR solve?

Since #3227 batch multiple changefeed patches into a batch and submit them as an etcd transaction, if there many changefeeds in the cdc cluster, it may cause a "etcdserver: too many operations in txn request\ error.

[2021/11/30 11:32:18.776 +08:00] [INFO] [etcd_worker.go:346] ["changefeed state"] ["changefeed state len"=0] [opsError="json: unsupported type: map[util.EtcdKey][]uint8"]
[2021/11/30 11:32:18.976 +08:00] [INFO] [etcd_worker.go:346] ["changefeed state"] ["changefeed state len"=0] [opsError="json: unsupported type: map[util.EtcdKey][]uint8"]
[2021/11/30 11:32:19.082 +08:00] [INFO] [etcd_worker.go:346] ["changefeed state"] ["changefeed state len"=180] [opsError="json: unsupported type: map[util.EtcdKey][]uint8"]
[2021/11/30 11:32:19.085 +08:00] [INFO] [capture.go:284] ["run owner exited"] [error="etcdserver: too many operations in txn request"] [errorVerbose="etcdserver: too many operations in txn request\ngithub.com/pingcap/errors.AddStack\n\tgithub.com/pingcap/errors@v0.11.5-0.20211009033009-93128226aaa3/errors.go:174\ngithub.com/pingcap/errors.Trace\n\tgithub.com/pingcap/errors@v0.11.5-0.20211009033009-93128226aaa3/juju_adaptor.go:15\ngithub.com/pingcap/ticdc/pkg/orchestrator.(*EtcdWorker).commitChangedState\n\tgithub.com/pingcap/ticdc/pkg/orchestrator/etcd_worker.go:391\ngithub.com/pingcap/ticdc/pkg/orchestrator.(*EtcdWorker).applyPatchGroups\n\tgithub.com/pingcap/ticdc/pkg/orchestrator/etcd_worker.go:333\ngithub.com/pingcap/ticdc/pkg/orchestrator.(*EtcdWorker).Run\n\tgithub.com/pingcap/ticdc/pkg/orchestrator/etcd_worker.go:203\ngithub.com/pingcap/ticdc/cdc/capture.(*Capture).runEtcdWorker\n\tgithub.com/pingcap/ticdc/cdc/capture/capture.go:304\ngithub.com/pingcap/ticdc/cdc/capture.(*Capture).campaignOwner\n\tgithub.com/pingcap/ticdc/cdc/capture/capture.go:282\ngithub.com/pingcap/ticdc/cdc/capture.(*Capture).run.func2\n\tgithub.com/pingcap/ticdc/cdc/capture/capture.go:203\nruntime.goexit\n\truntime/asm_amd64.s:1371"]

What is changed and how it works?

add etcdTxnMaxOps to limit the ops number of an etcd txn

Check List

Tests

  • Unit test
  • Manual test (add detailed scripts or steps below)

Code changes

  • Has exported function/method change
  • Has exported variable/fields change
  • Has interface methods change
  • Has persistent data change

Side effects

  • Possible performance regression
  • Increased code complexity
  • Breaking backward compatibility

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation
  • Need to update key monitor metrics in both TiCDC document and official document

Release note

Please add a release note.
If you don't think this PR needs a release note then fill it with `None`.

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Dec 1, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • liuzix
  • overvenus

To complete the pull request process, please ask the reviewers in the list 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 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.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 1, 2021
@asddongmen asddongmen added status/ptal Could you please take a look? component/replica-model Replication model component. labels Dec 1, 2021
@overvenus overvenus added the type/bugfix This PR fixes a bug. label Dec 1, 2021
Copy link
Member

@overvenus overvenus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Dec 1, 2021
@overvenus
Copy link
Member

Which versions are affected by this issue?

@asddongmen
Copy link
Contributor Author

asddongmen commented Dec 1, 2021

Which versions are affected by this issue?

no any for now

@asddongmen
Copy link
Contributor Author

/run-integration-tests

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Dec 2, 2021
@liuzix
Copy link
Contributor

liuzix commented Dec 2, 2021

/run-integration-tests

1 similar comment
@liuzix
Copy link
Contributor

liuzix commented Dec 2, 2021

/run-integration-tests

@overvenus
Copy link
Member

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 8610e1f

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Dec 2, 2021
@asddongmen
Copy link
Contributor Author

/run-dm-integration-tests

@ti-chi-bot ti-chi-bot merged commit 6f70625 into pingcap:master Dec 3, 2021
okJiang pushed a commit to okJiang/tiflow that referenced this pull request Dec 8, 2021
@asddongmen
Copy link
Contributor Author

This PR needs to cherrypick to release 5.3, 5.2, 5.1, 5.0, 4.0 branch.
I will do this manually.

@asddongmen asddongmen self-assigned this Dec 10, 2021
asddongmen added a commit to ti-chi-bot/tiflow that referenced this pull request Dec 15, 2021
asddongmen added a commit to ti-chi-bot/tiflow that referenced this pull request Dec 20, 2021
asddongmen added a commit to ti-chi-bot/tiflow that referenced this pull request Dec 20, 2021
asddongmen added a commit to ti-chi-bot/tiflow that referenced this pull request Dec 20, 2021
@asddongmen asddongmen deleted the fix_etcd_txn_operation_too_much branch December 22, 2021 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/replica-model Replication model component. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. status/ptal Could you please take a look? type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants