Skip to content

hot_region: check leader during handle expired item #9372

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

okJiang
Copy link
Member

@okJiang okJiang commented May 30, 2025

What problem does this PR solve?

Issue Number: Close #9366

What is changed and how does it work?

Check List

Tests

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

Release note

None.

Copy link
Contributor

ti-chi-bot bot commented May 30, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-triage-completed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. dco-signoff: yes Indicates the PR's author has signed the dco. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 30, 2025
@okJiang
Copy link
Member Author

okJiang commented May 30, 2025

/retest

@rleungx
Copy link
Member

rleungx commented May 30, 2025

/cc @lhy1024

@ti-chi-bot ti-chi-bot bot requested a review from lhy1024 May 30, 2025 04:47
@okJiang
Copy link
Member Author

okJiang commented Jun 3, 2025

/retest

@okJiang okJiang marked this pull request as ready for review June 3, 2025 03:57
@ti-chi-bot ti-chi-bot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 3, 2025
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 3, 2025
c.GetHotStat().CheckWriteAsync(checkExpiredTask)
c.GetHotStat().CheckReadAsync(checkExpiredTask)
c.GetHotStat().CheckReadAsync(checkLeaderChangeTask)
Copy link
Member Author

Choose a reason for hiding this comment

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

Should we check it for Write?

Copy link
Member

@rleungx rleungx Jun 3, 2025

Choose a reason for hiding this comment

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

Is it possible to reuse checkWritePeerTask?

Copy link
Member Author

@okJiang okJiang Jun 3, 2025

Choose a reason for hiding this comment

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

I'm not sure if need to do this check with write.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think justTransferLeader handles the leader change case in CheckPeerFlow, so it shouldn't run checkLeaderChangeTask on Write anymore.

Maybe we should strip out the relevant logic from CheckPeerFlow. But the code(CheckPeerFlow) is kind of crappy right now, and I don't really think of a better way to abstract it away.

Copy link
Contributor

Choose a reason for hiding this comment

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

It may need to be checked with write.

Copy link
Member Author

Choose a reason for hiding this comment

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

@lhy1024 Did you see this reply? #9372 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

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

You are right. We only need to solve hot read change by store heartbeat.

Signed-off-by: okJiang <[email protected]>
c.GetHotStat().CheckWriteAsync(checkExpiredTask)
c.GetHotStat().CheckReadAsync(checkExpiredTask)
c.GetHotStat().CheckReadAsync(checkLeaderChangeTask)
Copy link
Contributor

Choose a reason for hiding this comment

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

It may need to be checked with write.

Copy link
Contributor

ti-chi-bot bot commented Jun 6, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-06-06 02:51:22.689405368 +0000 UTC m=+582968.891750631: ☑️ agreed by lhy1024.

Copy link
Contributor

ti-chi-bot bot commented Jun 6, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lhy1024

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

The pull request process is described here

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 needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Jun 6, 2025
@okJiang
Copy link
Member Author

okJiang commented Jun 6, 2025

/retest

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. do-not-merge/needs-triage-completed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. 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.

Hot cache won't expired even if the leader is changed
3 participants