Skip to content

Disagg: refresh expiration time of snapshot when calling getSnapshot#9570

Merged
ti-chi-bot[bot] merged 4 commits intopingcap:masterfrom
JinheLin:refresh_expire
Oct 31, 2024
Merged

Disagg: refresh expiration time of snapshot when calling getSnapshot#9570
ti-chi-bot[bot] merged 4 commits intopingcap:masterfrom
JinheLin:refresh_expire

Conversation

@JinheLin
Copy link
Contributor

@JinheLin JinheLin commented Oct 30, 2024

What problem does this PR solve?

Issue Number: close #9567

Problem Summary:

After v7.5, TiFlash use read thread pool to read segments in disagg-mode and the segment will fetch pages only when it is going to be read.

If the query is slow, there is a high probability that the snapshot will expire before the query ends.

What is changed and how it works?

Refreshing the expiration time of snapshot when calling getSnapshot.


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

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 30, 2024
Comment on lines 1220 to -1221
auto timeout_s = context.getSettingsRef().disagg_task_snapshot_timeout;
auto expired_at = Clock::now() + std::chrono::seconds(timeout_s);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

disagg_task_snapshot_timeout can be smaller now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This depends on how long we expect a segment to be processed in the most extreme scenario.

Under normal circumstances, this expiration time has little impact because when the delta of the last segment is fetched, the snapshot will be immediately deleted (unregisterSnapshotIfEmpty).

Copy link
Member

@CalvinNeo CalvinNeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Oct 31, 2024
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Oct 31, 2024
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Oct 31, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-10-31 03:05:29.140981582 +0000 UTC m=+491841.980137120: ☑️ agreed by CalvinNeo.
  • 2024-10-31 03:26:57.105354391 +0000 UTC m=+493129.944509932: ☑️ agreed by Lloyd-Pottiger.

@Lloyd-Pottiger
Copy link
Contributor

/hold

@ti-chi-bot ti-chi-bot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 31, 2024
Signed-off-by: Lloyd-Pottiger <yan1579196623@gmail.com>
@Lloyd-Pottiger
Copy link
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 Oct 31, 2024
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Oct 31, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CalvinNeo, JaySon-Huang, Lloyd-Pottiger

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 [CalvinNeo,JaySon-Huang,Lloyd-Pottiger]

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 merged commit 5dd3a73 into pingcap:master Oct 31, 2024
@ti-chi-bot ti-chi-bot bot added the needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. label Oct 31, 2024
ti-chi-bot pushed a commit to ti-chi-bot/tiflash that referenced this pull request Oct 31, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.1: #9571.

yibin87 pushed a commit to yibin87/tiflash that referenced this pull request Nov 6, 2024
…ingcap#9570)

close pingcap#9567

Signed-off-by: Lloyd-Pottiger <yan1579196623@gmail.com>

Co-authored-by: Lloyd-Pottiger <60744015+Lloyd-Pottiger@users.noreply.github.com>
Co-authored-by: Lloyd-Pottiger <yan1579196623@gmail.com>
ti-chi-bot bot added a commit that referenced this pull request Nov 8, 2024
…9570) (#9571)

close #9567

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>

Co-authored-by: jinhelin <linjinhe33@gmail.com>
Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

workload report error “Check snap != nullptr failed: Can not find disaggregated task” when run ch

5 participants