Skip to content

event: account for raw rows in batch DML event size (#5960) - #5978

Open
ti-chi-bot wants to merge 1 commit into
pingcap:release-8.5from
ti-chi-bot:cherry-pick-5960-to-release-8.5
Open

event: account for raw rows in batch DML event size (#5960)#5978
ti-chi-bot wants to merge 1 commit into
pingcap:release-8.5from
ti-chi-bot:cherry-pick-5960-to-release-8.5

Conversation

@ti-chi-bot

Copy link
Copy Markdown
Member

This is an automated cherry-pick of #5960

What problem does this PR solve?

Issue Number: close #5959

Remote BatchDMLEvent instances keep their encoded row payload in RawRows
until the event collector calls AssembleRows. GetSize only accounted for
Rows, so dynamic stream memory control and byte-based batching treated the
remote row payload as zero bytes.

What is changed and how it works?

Make BatchDMLEvent.GetSize return the encoded RawRows length before rows
are assembled. After assembly, it continues to return the decoded chunk's
memory usage.

Extend the existing remote-row assembly unit test to verify size accounting
before serialization, after remote deserialization, and after row assembly.

Check List

Tests

  • Unit test
  • Manual test

Questions

Will it cause performance regression or break compatibility?

No compatibility impact. Remote batches may be split earlier when their actual
payload reaches the configured byte threshold, which is the intended behavior.

Do you need to update user documentation, design documentation or monitoring documentation?

No.

Release note

Fix dynamic stream memory and byte-batch accounting for remotely received DML batches.

Summary by CodeRabbit

  • Bug Fixes
    • Improved batch event size reporting when row data is stored in its encoded form.
    • Preserved accurate in-memory size reporting after row data is decoded and assembled.
  • Tests
    • Added coverage for size accounting before and after row data decoding.

Remote batch DML events retain their row payload in RawRows until the event collector handles them. Include that payload in GetSize so dynamic stream memory and byte batching account for it.
@ti-chi-bot ti-chi-bot added lgtm release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. type/cherry-pick-for-release-8.5 This PR is cherry-picked to release-8.5 from a source PR. labels Aug 14, 2026
@ti-chi-bot

ti-chi-bot Bot commented Aug 14, 2026

Copy link
Copy Markdown

This cherry pick PR is for a release branch and has not yet been approved by triage owners.
Adding the do-not-merge/cherry-pick-not-approved label.

To merge this cherry pick:

  1. It must be LGTMed and approved by the reviewers firstly.
  2. For pull requests to TiDB-x branches, it must have no failed tests.
  3. AFTER it has lgtm and approved labels, please wait for the cherry-pick merging approval from triage owners.
Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b5761c48-182f-46d8-9f60-26ca18c71709

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ti-chi-bot

ti-chi-bot Bot commented Aug 17, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: wlwilliamx

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

The pull request process is described here

Details Needs approval from an approver in each of these files:

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 added the approved label Aug 17, 2026
@wlwilliamx

Copy link
Copy Markdown
Collaborator

/test all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved do-not-merge/cherry-pick-not-approved lgtm release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. type/cherry-pick-for-release-8.5 This PR is cherry-picked to release-8.5 from a source PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants