Skip to content

[FIXED] Restore non-ordered sequences in filestore msg blocks#7303

Merged
neilalexander merged 1 commit intomainfrom
maurice/fs-corrupt-seq
Sep 12, 2025
Merged

[FIXED] Restore non-ordered sequences in filestore msg blocks#7303
neilalexander merged 1 commit intomainfrom
maurice/fs-corrupt-seq

Conversation

@MauriceVanVeen
Copy link
Copy Markdown
Member

When a message block was loaded, either through rebuildState or indexCacheBuf, it would not recover properly if the block was corrupted in some way and the sequences were not ordered (like seq 1, 3, 2, 4). This would both mark message 2 as deleted, and then mark message 3 as deleted when sequence 4 is encountered.

This fixes both recovery paths to only mark message 2 as deleted, and then skip over it. Or more generally, skip over any sequences that are lower than the highest sequence we've encountered last.

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

@MauriceVanVeen MauriceVanVeen requested a review from a team as a code owner September 12, 2025 11:13
Copy link
Copy Markdown
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>
Copy link
Copy Markdown
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

@neilalexander neilalexander merged commit 382d986 into main Sep 12, 2025
69 of 70 checks passed
@neilalexander neilalexander deleted the maurice/fs-corrupt-seq branch September 12, 2025 11:57
Copy link
Copy Markdown
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

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

LGTM

neilalexander added a commit that referenced this pull request Sep 12, 2025
…ible (#7304)

Related to the investigation in #7303.

Signed-off-by: Neil Twigg <neil@nats.io>
neilalexander added a commit that referenced this pull request Sep 29, 2025
Includes the following:

- #7290
- #7295
- #7291
- #7287
- #7299
- #7300
- #7297
- #7303
- #7304
- #7305
- #7309
- #7307
- #7320
- #7337
- #7344
- #7345
- #7348
- #7349
- #7350
- #7357
- #7356
- #7358
- #7367
- #7293

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.

3 participants