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

Clear replica states after we apply remote snapshot to recover #6347

Merged
merged 7 commits into from
Apr 11, 2024

Conversation

luluz66
Copy link
Contributor

@luluz66 luluz66 commented Apr 10, 2024

Related issues: N/A

Also added a test to verify.

// clearInMemoryReplicaState clears in-memory replica state.
func (sm *Replica) clearInMemoryReplicaState() {
sm.rangeMu.Lock()
sm.rangeDescriptor = nil
Copy link
Member

Choose a reason for hiding this comment

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

if a replica is opened and then raft calls RestoreFromSnapshot -- will clearReplicaState call store.Remove() before the replica is rewritten from the snapshot?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added store.RemoveRange() in ClearReplicaState if sm.rangeDescriptor is not nil

@luluz66 luluz66 merged commit 633fb52 into master Apr 11, 2024
18 checks passed
@luluz66 luluz66 deleted the snapshot-bug branch April 11, 2024 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants