Skip to content

Storages: Fix the statistics of user_read_bytes and add metrics (#10396)#10404

Merged
ti-chi-bot[bot] merged 3 commits intopingcap:release-8.5from
ti-chi-bot:cherry-pick-10396-to-release-8.5
Sep 9, 2025
Merged

Storages: Fix the statistics of user_read_bytes and add metrics (#10396)#10404
ti-chi-bot[bot] merged 3 commits intopingcap:release-8.5from
ti-chi-bot:cherry-pick-10396-to-release-8.5

Conversation

@ti-chi-bot
Copy link
Copy Markdown
Member

This is an automated cherry-pick of #10396

What problem does this PR solve?

Issue Number: ref #10380

  • ConcatSkippableBlockInputStream
    • When generating MVCC bitmaps using DeltaIndex, row_id is generated in DeltaMergeBlockInputStream. The getPlacedStream method sets the need_row_id parameter to false when obtaining the stable stream. Therefore, in ConcatSkippableBlockInputStream, need_row_id cannot be used to determine whether MVCC is involved.
    • This can be resolved by switching to a check based on read_tag.
  • DeltaValueReader
    • When we use getInputStreamNormal to read data, delta data is read through DeltaValueReader. Thus, DeltaValueReader needs to add statistics for user_read_bytes.
  • VersionChain
    • Track the read bytes consumed during the construction of MVCC bitmaps.
  • ScanContext
    • Encapsulate the reporting of primary user_read_bytes and metrics within ScanContext.
  • Mark the read operations for updating DeltaIndex and VersionChain as ReadTag::Internal.
  • TiFlashMetrics
    • Add storage-layer RU (Resource Usage) monitoring.
image image

What is changed and how it works?


Check List

Tests

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

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

None

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot ti-chi-bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 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 Sep 4, 2025
@ti-chi-bot
Copy link
Copy Markdown
Member Author

@JinheLin 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.

@ti-chi-bot
Copy link
Copy Markdown
Contributor

ti-chi-bot Bot commented Sep 4, 2025

@ti-chi-bot: ## If you want to know how to resolve it, please read the guide in TiDB Dev Guide.

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 ti-community-infra/tichi repository.

@ti-chi-bot ti-chi-bot Bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. cherry-pick-approved Cherry pick PR approved by release team. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. do-not-merge/cherry-pick-not-approved labels Sep 4, 2025
@ti-chi-bot ti-chi-bot Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Sep 8, 2025
@ti-chi-bot ti-chi-bot Bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Sep 8, 2025
@JinheLin
Copy link
Copy Markdown
Contributor

JinheLin commented Sep 9, 2025

/hold

testing

@JinheLin
Copy link
Copy Markdown
Contributor

JinheLin commented Sep 9, 2025

/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 Sep 9, 2025
@ti-chi-bot ti-chi-bot Bot added the lgtm label Sep 9, 2025
@ti-chi-bot
Copy link
Copy Markdown
Contributor

ti-chi-bot Bot commented Sep 9, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JaySon-Huang, JinheLin

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:
  • OWNERS [JaySon-Huang,JinheLin]

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 Sep 9, 2025
@ti-chi-bot
Copy link
Copy Markdown
Contributor

ti-chi-bot Bot commented Sep 9, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-09-08 16:27:52.936649448 +0000 UTC m=+292339.496530935: ☑️ agreed by JaySon-Huang.
  • 2025-09-09 01:17:14.069289234 +0000 UTC m=+324100.629170721: ☑️ agreed by JinheLin.

@ti-chi-bot ti-chi-bot Bot merged commit 7417e50 into pingcap:release-8.5 Sep 9, 2025
4 checks passed
@ti-chi-bot ti-chi-bot Bot deleted the cherry-pick-10396-to-release-8.5 branch September 9, 2025 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved cherry-pick-approved Cherry pick PR approved by release team. lgtm release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 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.

3 participants