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

encoder (CDC) shrink the bytes.Buffer to reduce memory usage #10417

Merged
merged 8 commits into from
Jan 5, 2024

Conversation

zhangjinpeng87
Copy link
Contributor

What problem does this PR solve?

Issue Number: close #10416

What is changed and how it works?

  • Because bytes.Buffer has no way to shrink its internal buf, we re-create a new bytes.Buffer for csv/canal encoder after its bytes.Buffer's memory usage exceeded specified threshold (1MB, because 1MB is not trivial in terms of memory allocator and TiCDC memory usage) instead of reusing it.

Check List

Tests

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

Questions

Will it cause performance regression or break compatibility?
Do you need to update user documentation, design documentation or monitoring documentation?

Release note

`None`.

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 4, 2024
@zhangjinpeng87
Copy link
Contributor Author

/test dm-integration-test

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Jan 4, 2024
@ti-chi-bot ti-chi-bot bot added the lgtm label Jan 4, 2024
Copy link
Contributor

ti-chi-bot bot commented Jan 4, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: asddongmen, CharlesCheung96

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [CharlesCheung96,asddongmen]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jan 4, 2024
Copy link
Contributor

ti-chi-bot bot commented Jan 4, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-01-04 02:47:57.549133886 +0000 UTC m=+2311568.586360799: ☑️ agreed by CharlesCheung96.
  • 2024-01-04 07:38:01.138781244 +0000 UTC m=+2328972.176008173: ☑️ agreed by asddongmen.

@zhangjinpeng87 zhangjinpeng87 self-assigned this Jan 4, 2024
@zhangjinpeng87
Copy link
Contributor Author

/test cdc-integration-storage-test

@zhangjinpeng87
Copy link
Contributor Author

/test dm-integration-test

3 similar comments
@zhangjinpeng87
Copy link
Contributor Author

/test dm-integration-test

@zhangjinpeng87
Copy link
Contributor Author

/test dm-integration-test

@zhangjinpeng87
Copy link
Contributor Author

/test dm-integration-test

@ti-chi-bot ti-chi-bot bot merged commit 44b19bf into pingcap:master Jan 5, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

csv/canal encoder (cdc) never shrink the memory buffer
3 participants