Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

ranking: remove old code path#57468

Merged
stefanhengl merged 8 commits into
mainfrom
sh/document-ranking-remove-alt-code-path
Oct 10, 2023
Merged

ranking: remove old code path#57468
stefanhengl merged 8 commits into
mainfrom
sh/document-ranking-remove-alt-code-path

Conversation

@stefanhengl

@stefanhengl stefanhengl commented Oct 9, 2023

Copy link
Copy Markdown
Member

The enhanced ranking logic is GA since 5.1. So far we haven't had any issue so we should remove the old code path with 5.3.

Test plan:
CI

@cla-bot cla-bot Bot added the cla-signed label Oct 9, 2023
@stefanhengl stefanhengl requested a review from a team October 9, 2023 15:29
@stefanhengl stefanhengl marked this pull request as ready for review October 9, 2023 15:30
@sourcegraph-bot

sourcegraph-bot commented Oct 9, 2023

Copy link
Copy Markdown
Contributor

Codenotify: Notifying subscribers in CODENOTIFY files for diff c70295c...276f08f.

Notify File(s)
@jtibshirani internal/search/backend/aggregate.go
internal/search/backend/horizontal.go
internal/search/backend/horizontal_test.go
internal/search/backend/metered_searcher.go
internal/search/client/client.go
internal/search/types.go
internal/search/types_test.go
@keegancsmith internal/search/backend/aggregate.go
internal/search/backend/horizontal.go
internal/search/backend/horizontal_test.go
internal/search/backend/metered_searcher.go
internal/search/client/client.go
internal/search/types.go
internal/search/types_test.go

Comment thread CHANGELOG.md Outdated

-
- The following experimental settings in site-configuration have not been used by the backend since version 5.1 and are now deprecated: `maxReorderQueueSize`, `maxQueueMatchCount`, `maxReorderDurationMS`. [#57468](https://github.com/sourcegraph/sourcegraph/pull/57468)
- The feature-flag `search-ranking`, which allowed to disable the improved ranking introduced in 5.1, is now deprecated. [#57468](https://github.com/sourcegraph/sourcegraph/pull/57468)

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.

you may want to rebase first, I think a new section in the changelog was recently added for 5.2.1 that git merge logic may decide to move this into.

Should we mention setting them is a noop now? Deprecated normally implies we will remove them but they still work.

Comment on lines +128 to +133
if opts == nil {
return &nopFlushCollector{sender}
}

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.

maybe keep the doc string on why we allow nil opts? Can we just get rid of this.

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.

The searcher interface allows nil options which I believe is the root cause of the problem. Apart from tests, there are call sites in "insights" which call with nil options. I will put the doc string back.

Comment on lines -185 to -188
metricReorderQueueSize.WithLabelValues().Observe(float64(rq.metricMaxLength))
metricMaxMatchCount.WithLabelValues().Observe(float64(rq.metricMaxMatchCount))
metricFinalQueueSize.Add(float64(rq.queue.Len()))
metricMaxSizeBytes.WithLabelValues().Observe(float64(rq.metricMaxSizeBytes))

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 think we have dashboards on these? Need to update them

The enhanced ranking logic is GA since 5.1. So far we haven't had any
issue so we should remove the old code path with 5.3.

Test plan:
CI
There are no dashboards connected to these metrics
@stefanhengl stefanhengl force-pushed the sh/document-ranking-remove-alt-code-path branch from 35fb7a5 to 910b4a5 Compare October 10, 2023 09:45
@stefanhengl stefanhengl merged commit f75cb7c into main Oct 10, 2023
@stefanhengl stefanhengl deleted the sh/document-ranking-remove-alt-code-path branch October 10, 2023 11:30
Comment thread internal/search/types.go
searchOpts.DocumentRanksWeight = conf.SearchDocumentRanksWeight()
}
// This enables the use of document ranks in scoring, if they are available.
searchOpts.UseDocumentRanks = true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I assume we're not removing the repo-based ranking code path from Zoekt (because there are other users/ clients depending on that)?

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.

I didn't plan to change anything in Zoekt. I assume most if not all other clients don't use document ranks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants