Skip to content

[FIXED] Detect removed blocks with stale index.db #7123

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

Merged
merged 1 commit into from
Jul 31, 2025

Conversation

MauriceVanVeen
Copy link
Member

The filestore could contain 3 blocks, had a successful write to the last message block, and wrote a valid index.db containing those 3 blocks. If a block was deleted (but was not the last) and the server had an ungraceful shutdown, the removed block was not recognized. This would result in the index.db being regarded as valid and loading messages in that block to return loadBlock error: message block data missing errors.

This PR fixes that by recognizing certain files don't exist on disk anymore, adds those to the lost data, and rebuilds the index.

Signed-off-by: Maurice van Veen [email protected]

@MauriceVanVeen MauriceVanVeen requested a review from a team as a code owner July 30, 2025 18:34
Copy link
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

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

@neilalexander neilalexander merged commit 6a7104b into main Jul 31, 2025
69 of 70 checks passed
@neilalexander neilalexander deleted the maurice/stale-index-rm-blk branch July 31, 2025 08:30
neilalexander added a commit that referenced this pull request Jul 31, 2025
Includes the following:

* #7117
* #7123

Signed-off-by: Neil Twigg <[email protected]>
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