Skip to content

Fix zoekt/client issues

Dmitry Gruzd requested to merge fix-zoekt-client into master

What does this MR do and why?

This MR fixes 2 issues with ee/lib/gitlab/search/zoekt/client.rb:

  1. Memoization causes shard_id to be fixed for one client instance
irb(main):038:0> Gitlab::Search::Zoekt::Client.instance.send(:node, 2).id
=> 2
irb(main):039:0> Gitlab::Search::Zoekt::Client.instance.send(:node, 1).id
=> 2
  1. URI.join doesn't work correct for our new use case. If you use non-root base_url, it returns incorrect address
[30] pry(main)> URI.join('http://gitlab-gitlab-zoekt.default.svc.cluster.local:8080/nodes/gitlab-gitlab-zoekt-0.gitlab-gitlab-zoekt.default.svc.cluster.local', '/api/search')
=> #<URI::HTTP http://gitlab-gitlab-zoekt.default.svc.cluster.local:8080/api/search>

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Ravi Kumar

Merge request reports