Skip to content

indexserver: delete fully tombstoned compound shards instead of merging - #1215

Merged
keegancsmith merged 1 commit into
mainfrom
k/vacuum-empty-compound-shard
Oct 28, 2026
Merged

keegancsmith merged 1 commit into
mainfrom
k/vacuum-empty-compound-shard

Conversation

@keegancsmith

@keegancsmith keegancsmith commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

When every repo in a compound shard is tombstoned, vacuum merges the shard with itself and writes an empty compound-da39a3ee… shard that zoekt-webserver can't load (len(repos)=0. Cannot backfill ID). This was seen on dotcom.

removeTombstones now deletes such a shard instead of merging it. index.Merge also refuses to write a shard with no repositories.

#1088 already cleans up empty shards on explode. This is a smaller alternative to #1089, which does more but is blocked on a cleanup bug that can delete valid shards.

When every repo in a compound shard was tombstoned, vacuum still merged the
shard with itself. The merge kept no repos, so it wrote an empty
compound-da39a3ee..._v17 shard (the SHA1 of no names) that NewSearcher
rejects with "len(repos)=0. Cannot backfill ID". This happened on
dotcom indexed-search pods.

removeTombstones now deletes such a shard without merging. index.Merge also
refuses to write a shard with no repos, so no other caller can produce one.
Explode already removes empty shards that exist on disk (#1088).

Amp-Thread-ID: https://ampcode.com/threads/T-55117bf6-2d9c-44b2-8268-923e35450020
@keegancsmith
keegancsmith force-pushed the k/vacuum-empty-compound-shard branch from e2b2e4f to 8a5f485 Compare October 27, 2026 19:02
@keegancsmith
keegancsmith marked this pull request as ready for review October 27, 2026 19:03
@keegancsmith
keegancsmith enabled auto-merge (squash) October 27, 2026 19:03

@stefanhengl stefanhengl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@keegancsmith
keegancsmith merged commit c0b97d2 into main Oct 28, 2026
7 checks passed
@keegancsmith
keegancsmith deleted the k/vacuum-empty-compound-shard branch October 28, 2026 07:33
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.

2 participants