Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

uv: Set start_index correctly when no closed segments present #218

Merged
merged 1 commit into from Jul 2, 2021

Conversation

MathieuBordere
Copy link
Contributor

This issue came up while running the jepsen tests, steps are roughly:

  • Node receives snapshot install and deletes all closed segments
    preceding the snapshot.
  • After installing the snapshot, the node receives AppendEntries and
    adds the entries to an open segment.
  • Node gets killed.
  • Node boots and UvLoad closes the open segment using start_index 1,
    ignoring the index of the snapshot that is present in the data dir.
  • Node fails to start because the newly closed segment and the snapshot are
    inconsistent with a message
    raft_start(): io: last entry on disk has index 383, which is behind last snapshot's index 3072"

Signed-off-by: Mathieu Borderé mathieu.bordere@canonical.com

This issue came up while running the jepsen tests, steps are roughly:
- Node receives snapshot install and deletes all closed segments
preceding the snapshot.
- After installing the snapshot, the node receives AppendEntries and
adds the entries to an open segment.
- Node gets killed.
- Node boots and UvLoad closes the open segment using start_index 1,
ignoring the index of the snapshot that is present in the data dir.
- Node fails to start because the newly closed segment and the snapshot are
inconsistent with a message
`raft_start(): io: last entry on disk has index 383, which is behind
last snapshot's index 3072"`

Signed-off-by: Mathieu Borderé <mathieu.bordere@canonical.com>
Copy link
Contributor

@freeekanayaka freeekanayaka left a comment

Choose a reason for hiding this comment

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

Nice catch.

@stgraber stgraber merged commit 4c71b94 into canonical:master Jul 2, 2021
@MathieuBordere MathieuBordere deleted the bugfix/start-index branch December 9, 2022 10:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants