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

Is zoekt indexing crash consistent #710

Closed
shubham149 opened this issue Dec 18, 2023 · 3 comments
Closed

Is zoekt indexing crash consistent #710

shubham149 opened this issue Dec 18, 2023 · 3 comments

Comments

@shubham149
Copy link

I wanted to check whether zoekt indexing is crash consistent. If not, will re-indexing all the repositories on startup (after crash) ensure that indexing is in consistent state?

@shubham149 shubham149 changed the title Is zoekt index crash consistent Is zoekt indexing crash consistent Dec 18, 2023
@keegancsmith
Copy link
Member

cc @sourcegraph/search-platform

@jtibshirani
Copy link
Member

@shubham149 I'm sorry for the very slow response here! Confirming I understand: when you say "crash consistent", you mean snapshot consistency. For example, if Zoekt was indexing a new commit, and the machine crashed at any point in indexing, the disk still represents a valid data snapshot and doesn't contain inconsistencies (like mix of old and new commits, some data missing, etc.).

Zoekt is not guaranteed to be crash consistent. However, the indexing strategy is quite simple and it would be possible to make it consistent. Details:

  • Each index is a collection of immutable files
  • Each file represents a shard for a single repo
  • To reindex, we create a temporary directory and rename the files once all repo shards are finished

Let us know if you have other questions or are interested in contributing improvements.

@shubham149
Copy link
Author

Thans @jtibshirani for the updates

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

No branches or pull requests

3 participants