Skip to content
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

Fixing SyncedFileSystemDirectoryFactory when the main index is corrupted #387

Open
wants to merge 8 commits into
base: release/3.0
Choose a base branch
from

Conversation

Shazwazza
Copy link
Owner

@Shazwazza Shazwazza commented Jun 26, 2024

Looking at stack traces reported from SyncedFileSystemDirectoryFactory shows that the errors always come from when the directory is first opened (i.e. site startup).

This adds an index checker and the ability to try to repair the index. The check will happen before the index is attempted to be open. If the check fails, it will try to fix it and report on the outcome. If a fix occurs, this generally means that documents may be lost, however, they might have been removed documents in the first place but the segments file wasn't updated during the syncing.

The index will then attempted to be read, if that fails, a new index will be created.

  • If the main index is unhealthy, check the local index, if it is healthy then eagerly sync back to main before initializing.
  • If the main index is unhealthy and no way to restore from local, do we want to 'fix' it which may end up removing documents? In some cases, the documents that will be removed, should be removed since this would have resulted from syncing deleted files but not have synced the segments file correctly. Alternatively, we would just clear the index and a rebuild would be needed (forced by Umbraco for example)

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.

None yet

1 participant