all: compound shard support (#95)
This commit adds support for compound shards. A shard now has multiple
repositories associated with it, rather than always one. Most of zoekt
is document based, so minimal changes are required in the core search
evaluation codepath. The only change here is the addition of a mapping
from document to repo and storing the subrepo paths per repo.
The other change is the addition of tombstones. A tombstoned repository
is hidden from List and Search results. This was added so we can index a
new version of a repository in a compound shard without the need of
recomputing the whole shard.
This commit is mostly focussed on the read path. It ensures everything
keeps working correctly once compound shards are introduced. However,
the write path is mostly missing. We add a merge command for manual
merging. However, zoekt-sourcegraph-indexserver is mostly unaware of
compound shards and has no way to mutate them. This will be follow-up
work.
To support compound shards we had to bump the indexed format
version. This is since the repoMetaData field is not backwards
compatible. However, we know we plan on making other changes to the
index format. So we introduced NextIndexFormatVersion. With this change
we will continue to use v16, unless a common opts into v17. This will
allow us to effectively feature flag the new format while we work on it.
Co-authored-by: Stefan Hengl <stefan@sourcegraph.com>
This is a binary file and will not be displayed.
This is a binary file and will not be displayed.