Skip to content

Conversation

MauriceVanVeen
Copy link
Member

@MauriceVanVeen MauriceVanVeen commented Aug 11, 2025

  • panic fix: the panic was caused by trying to truncate a block that doesn't exist. This would fail silently before. The fix allows us to truncate to a sequence where the whole message block should be removed.

  • remove index.db first: part of the issue was that an old/ahead index.db would be preserved if we'd be hard killed halfway during truncation. Now remove that index first, so we recover based on the messages normally, and don't try to hold a last seq that's ahead and should have been truncated.

  • truncate to previous correct entry: the Raft logic would not truncate to the correct index on startup (off-by-one), this would result in the Wrong index and Resetting WAL state issues.

Signed-off-by: Maurice van Veen github@mauricevanveen.com

@MauriceVanVeen MauriceVanVeen requested a review from a team as a code owner August 11, 2025 16:34
@MauriceVanVeen MauriceVanVeen changed the title [FIXED] Truncate to removed block [FIXED] Truncate to removed block & hard kill recovery Aug 13, 2025
Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
@MauriceVanVeen MauriceVanVeen force-pushed the maurice/truncate-removed-block branch from af5ac7a to 399bf1e Compare August 13, 2025 09:00
Copy link
Member

@neilalexander neilalexander left a comment

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
@MauriceVanVeen MauriceVanVeen force-pushed the maurice/truncate-removed-block branch from 399bf1e to 33bde8b Compare August 13, 2025 09:16
@neilalexander neilalexander merged commit e56042f into main Aug 13, 2025
131 of 136 checks passed
@neilalexander neilalexander deleted the maurice/truncate-removed-block branch August 13, 2025 09:58
neilalexander added a commit that referenced this pull request Aug 13, 2025
Includes the following:

- #7140
- #7142
- #7145
- #7150
- #7151
- #7154
- #7156
- #7122
- #7166 (excluding the Go
version bump)
- #7162
- #7165

Signed-off-by: Neil Twigg <neil@nats.io>
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.

2 participants