Skip to content

txnkv: add readPoolTaskDetails to SnapshotRuntimeStats (#2025)#2030

Merged
ti-chi-bot[bot] merged 4 commits into
tikv:release-nextgen-202603from
ti-chi-bot:cherry-pick-2025-to-release-nextgen-202603
Jul 24, 2026
Merged

txnkv: add readPoolTaskDetails to SnapshotRuntimeStats (#2025)#2030
ti-chi-bot[bot] merged 4 commits into
tikv:release-nextgen-202603from
ti-chi-bot:cherry-pick-2025-to-release-nextgen-202603

Conversation

@ti-chi-bot

Copy link
Copy Markdown
Member

This is an automated cherry-pick of #2025

What problem does this PR solve?

Issue Number: ref https://github.com/tidbcloud/cloud-storage-engine/issues/5480

Problem Summary:

TiKV/CSE can now return optional request-level read-pool scheduling and execution metrics in ExecDetailsV2.read_pool_task_details. client-go currently drops these details, so TiDB and other downstream consumers cannot include read-pool queueing, wakeup, dispatch/poll, and CPU/wall-time breakdowns in snapshot runtime diagnostics.

What is changed and how it works?

  • Bump kvproto to the revision that adds PoolTaskDetails to ExecDetailsV2.
  • Add util.PoolTaskDetails to aggregate reported task samples, including:
    • task, poll, and dispatch counts;
    • task wall time, queue wait, wake wait, and poll CPU/wall time;
    • total, minimum, and maximum values;
    • fair-queue waited-task-slice statistics.
  • Merge read_pool_task_details from responses into SnapshotRuntimeStats.
  • Support cloning, merging, empty checks, and compact string formatting for the aggregate.
  • Expose GetReadPoolTaskDetails() as a defensive copy so callers cannot mutate the stored runtime stats.
  • Keep the field lazy and backward-compatible: responses from older servers do not allocate or print empty read-pool statistics.
  • Refresh root, integration-test, and example module metadata for the new kvproto revision.

The aggregation operates on reported response samples because the protobuf currently carries no task identity or delta information.

Check List

  • Unit tests
    • go test ./util ./txnkv/txnsnapshot
    • go test --tags=intest ./util ./txnkv/txnsnapshot
  • Backward compatibility
    • The protobuf field is additive and optional.
    • Existing behavior is unchanged when read_pool_task_details is absent.

Related changes

Summary by CodeRabbit

  • New Features
    • Enhanced snapshot runtime statistics to include read-pool task details (poll/dispatch and related timing/wait metrics).
    • Added aggregation support so read-pool details can be merged, cloned, formatted, and retrieved from runtime stats.
  • Maintenance
    • Bumped Go toolchain and refreshed several indirect module versions across examples and integration.
    • Updated the primary kv-proto dependency revision.
  • Tests
    • Added unit and integration test coverage for read-pool metric aggregation, formatting, merge/clone behavior, and empty-state handling.

@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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. type/cherry-pick-for-release-nextgen-202603 labels Jul 24, 2026
@ti-chi-bot

Copy link
Copy Markdown
Member Author

@lcwangchao 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

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2f79b1b1-2f24-41f3-ae94-9370becdc649

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@lcwangchao

Copy link
Copy Markdown
Contributor

/unhold

@ti-chi-bot ti-chi-bot Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 24, 2026
@lcwangchao

Copy link
Copy Markdown
Contributor

/retest

@lcwangchao
lcwangchao force-pushed the cherry-pick-2025-to-release-nextgen-202603 branch 2 times, most recently from 56dd220 to 7582747 Compare July 24, 2026 08:12
ref tidbcloud/cloud-storage-engine#5480

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Signed-off-by: Chao Wang <cclcwangchao@hotmail.com>
Signed-off-by: Chao Wang <cclcwangchao@hotmail.com>
Signed-off-by: Chao Wang <cclcwangchao@hotmail.com>
Signed-off-by: Chao Wang <cclcwangchao@hotmail.com>
@lcwangchao
lcwangchao force-pushed the cherry-pick-2025-to-release-nextgen-202603 branch from 7582747 to c992c2f Compare July 24, 2026 08:21
@ti-chi-bot ti-chi-bot Bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jul 24, 2026
@ti-chi-bot ti-chi-bot Bot added the lgtm label Jul 24, 2026
@ti-chi-bot

ti-chi-bot Bot commented Jul 24, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cfzjywxk, lcwangchao

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 approved and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jul 24, 2026
@ti-chi-bot

ti-chi-bot Bot commented Jul 24, 2026

Copy link
Copy Markdown

[LGTM Timeline notifier]

Timeline:

  • 2026-07-24 08:23:15.853350109 +0000 UTC m=+1565981.889445195: ☑️ agreed by lcwangchao.
  • 2026-07-24 08:31:19.97789284 +0000 UTC m=+1566466.013987895: ☑️ agreed by cfzjywxk.

@ti-chi-bot
ti-chi-bot Bot merged commit 9d3413c into tikv:release-nextgen-202603 Jul 24, 2026
13 checks passed
@lcwangchao
lcwangchao deleted the cherry-pick-2025-to-release-nextgen-202603 branch July 24, 2026 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved dco-signoff: yes Indicates the PR's author has signed the dco. lgtm size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. type/cherry-pick-for-release-nextgen-202603

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants