Skip to content

Conversation

@ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #1841

This PR tries to prevent issues like #1839 by pre-encoding request.

The micro-bench results show that the overhead introduced by this PR is negligible. Besides, we can reduce the mem allocs of AttachContext after this PR.

workload threads pre-encode baseline diff
pointget 64 83120.35 83940.81 -0.98%
batchget 64 24469.9 24629.87 -0.65%
tblscan 64 41522.92 41565.02 -0.10%
idxscan 64 40363.22 40328.56 0.09%
idxlookup 64 16482.58 16497.08 -0.09%

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced error handling for batch request encoding with improved validation of request states.
  • Chores

    • Optimized batch request processing through object pooling to reduce memory allocations and improve efficiency.
    • Refined request lifecycle management with better cleanup and state tracking.
  • Tests

    • Added comprehensive test coverage for batch encoding, pooling reuse, and concurrent operations to ensure reliability.

✏️ Tip: You can customize this high-level summary in your review settings.

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot ti-chi-bot added dco-signoff: yes Indicates the PR's author has signed the dco. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. type/cherry-pick-for-tidb-8.5 labels Jan 20, 2026
@ti-chi-bot
Copy link
Member Author

@zyguan This PR has conflicts, I have hold it.
Please resolve them or ask others to resolve them, then comment /unhold to remove the hold label.

@coderabbitai
Copy link

coderabbitai bot commented Jan 20, 2026

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.

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


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

Signed-off-by: zyguan <zhongyangguan@gmail.com>
@ti-chi-bot
Copy link

ti-chi-bot bot commented Jan 20, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from zyguan. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found 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

@zyguan
Copy link
Contributor

zyguan commented Jan 20, 2026

/retest

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

Labels

dco-signoff: yes Indicates the PR's author has signed the dco. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. type/cherry-pick-for-tidb-8.5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants