Skip to content
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

Handle MsgSnapshot sent before MsgAppend #389

Merged
merged 5 commits into from
Aug 13, 2024

Conversation

CalvinNeo
Copy link
Member

@CalvinNeo CalvinNeo commented Aug 12, 2024

What is changed and how it works?

Issue Number: Close #xxx

According to https://github.com/tikv/raft-rs/blob/2aefbf627f243dd261b7585ef1250d32efd9dfe7/src/raft.rs#L842,
if log is truncated in Leader, a MsgSnapshot may be sent directly before a MsgAppend.
If such MsgSnapshot is received when a FAP snapshot IS BUILDING, then it will be dropped.

What's Changed:


Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • Need to cherry-pick to the release branch

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

Release note


@ti-chi-bot ti-chi-bot bot added the size/L label Aug 12, 2024
Signed-off-by: Calvin Neo <[email protected]>
@ti-chi-bot ti-chi-bot bot added size/XL and removed size/L labels Aug 12, 2024
Signed-off-by: Calvin Neo <[email protected]>
f
Signed-off-by: Calvin Neo <[email protected]>
@ti-chi-bot ti-chi-bot bot added the lgtm label Aug 13, 2024
Copy link

ti-chi-bot bot commented Aug 13, 2024

[APPROVALNOTIFIER] This PR is APPROVED

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

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

Copy link

ti-chi-bot bot commented Aug 13, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-08-13 02:35:32.449685909 +0000 UTC m=+235417.153155554: ☑️ agreed by JaySon-Huang.

@ti-chi-bot ti-chi-bot bot added the approved label Aug 13, 2024
Comment on lines +102 to +104
info!("fast path: ongoing {}:{} {}, MsgSnapshot rejected",
self.store_id, region_id, new_peer_id;
"to_peer_id" => msg.get_to_peer().get_id(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: format

Suggested change
info!("fast path: ongoing {}:{} {}, MsgSnapshot rejected",
self.store_id, region_id, new_peer_id;
"to_peer_id" => msg.get_to_peer().get_id(),
info!("fast path: ongoing {}:{} {}, MsgSnapshot rejected",
self.store_id, region_id, new_peer_id;
"to_peer_id" => msg.get_to_peer().get_id(),

f
Signed-off-by: Calvin Neo <[email protected]>
@CalvinNeo
Copy link
Member Author

/retest

@ti-chi-bot ti-chi-bot bot merged commit 114b74c into pingcap:raftstore-proxy Aug 13, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants