hashicorp / hashicorp/raft

Panic getting logs after restoring from an older snapshot

Open
#85 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
9.1k
Forks
1.1k
Avg merge
3h 27m
Merged PRs (30d)
2

Description

https://gist.github.com/fahadullah/6089c60bf6c57da0143b

When we restore a snapshot, the lastApplied index is set to the snapshot index. If we can't restore from the latest snapshot, lastApplied index is set to an old value, X. As we had a successful snapshot afterwords, append log doesn't have log entries from X+1 to the last index and it panics looking up the missing entries.

I would have assumed we would move the applied index forward or fail to restart completely in this case instead of failing later.

Contributor guide

Open the contributing guide

Research direction

Start with the reproduction in the linked gist and trace snapshot restore through lastApplied and the append-log lookup. Reproduce the panic, then verify that restart either advances the applied index safely or fails immediately rather than panicking later.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.