Skip to content

feat/indexserver: extend UpdateIndexStatus request#1068

Merged
stefanhengl merged 4 commits into
mainfrom
stefanhengl/report-zoekt-index-status-failures-proto
Jun 4, 2026
Merged

feat/indexserver: extend UpdateIndexStatus request#1068
stefanhengl merged 4 commits into
mainfrom
stefanhengl/report-zoekt-index-status-failures-proto

Conversation

@stefanhengl
Copy link
Copy Markdown
Member

@stefanhengl stefanhengl commented Jun 3, 2026

This expands the UpdateIndexStatus RPC contract so Sourcegraph can land its side of failed index status handling before Zoekt starts sending new runtime behavior. The request now carries an explicit repository state and optional failure message, while keeping UNSPECIFIED as the zero value so older clients remain backward compatible when they omit the new field.

This PR is intentionally contract-only. A follow-up Zoekt change will start reporting failed index attempts once the Sourcegraph side is ready to consume them.

Add repository state and failure message fields to UpdateIndexStatusRequest.

This lets Sourcegraph depend on the expanded contract before Zoekt starts
reporting failed indexing attempts. The zero enum value remains
UNSPECIFIED so older clients stay backward compatible when they omit the
new field.
@stefanhengl stefanhengl requested a review from keegancsmith June 3, 2026 07:53
@stefanhengl stefanhengl marked this pull request as ready for review June 3, 2026 07:53
Copy link
Copy Markdown
Member

@keegancsmith keegancsmith left a comment

Choose a reason for hiding this comment

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

Is it not worth setting these fields already in this PR?

@stefanhengl
Copy link
Copy Markdown
Member Author

Is it not worth setting these fields already in this PR?

you are right. I updated the PR. Sourcegraph currently doesn't read the new fields so everything will work like before until I land the corresponding change in Sourcegraph.

failureMessage = indexErr.Error()
} else {
// We need to read from disk for IndexTime.
_, metadata, ok, err := c.findRepositoryMetadata(args)
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.

I wonder if we should still do this anyways? If indexing fails we will still have the old shard on disk?

Copy link
Copy Markdown
Member Author

@stefanhengl stefanhengl Jun 3, 2026

Choose a reason for hiding this comment

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

We can do it best-effort. We might not have an index, for example, if indexing never worked or an index was deleted manually. Right now the idea is that we only update index time in Sourcegraph if status == success.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Updated to read the metadata but not block on it.

@stefanhengl stefanhengl merged commit 244807b into main Jun 4, 2026
7 checks passed
@stefanhengl stefanhengl deleted the stefanhengl/report-zoekt-index-status-failures-proto branch June 4, 2026 06:41
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