Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions cmd/zoekt-sourcegraph-indexserver/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ func (o *indexArgs) BuildOptions() *index.Options {
// nothing needs to be done.
RepositoryDescription: zoekt.Repository{
TenantID: o.TenantID,
ID: o.IndexOptions.RepoID,
ID: o.RepoID,
Name: o.Name,
Branches: o.Branches,
RawConfig: map[string]string{
"repoid": strconv.Itoa(int(o.IndexOptions.RepoID)),
"repoid": strconv.Itoa(int(o.RepoID)),
"priority": strconv.FormatFloat(o.Priority, 'g', -1, 64),
"public": marshalBool(o.Public),
"fork": marshalBool(o.Fork),
Expand All @@ -135,9 +135,6 @@ func (o *indexArgs) BuildOptions() *index.Options {
LanguageMap: o.LanguageMap,

ShardMerging: o.ShardMerging,

TenantID: o.TenantID,
RepoID: o.RepoID,
}
}

Expand Down
10 changes: 2 additions & 8 deletions index/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,6 @@ type Options struct {
//
// Note: heap checking is "best effort", and it's possible for the process to OOM without triggering the heap profile.
HeapProfileTriggerBytes uint64

// TenantID is the ID of the tenant this shard belongs to.
TenantID int

// RepoID is the ID of the repository this shard belongs to.
RepoID uint32
}

// HashOptions contains only the options in Options that upon modification leads to IndexState of IndexStateMismatch during the next index building.
Expand Down Expand Up @@ -343,8 +337,8 @@ func (o *Options) shardNameVersion(version, n int) string {
var prefix string

// If tenant enforcement is enabled and we have tenant/repo IDs, use those to generate the prefix
if o.TenantID != 0 && o.RepoID != 0 && tenant.EnforceTenant() {
prefix = tenant.SrcPrefix(o.TenantID, o.RepoID)
if o.RepositoryDescription.TenantID != 0 && o.RepositoryDescription.ID != 0 && tenant.EnforceTenant() {
prefix = tenant.SrcPrefix(o.RepositoryDescription.TenantID, o.RepositoryDescription.ID)
} else {
prefix = o.RepositoryDescription.Name
}
Expand Down
5 changes: 0 additions & 5 deletions index/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,6 @@ func explode(dstDir string, f IndexFile, ibFuncs ...shardBuilderFunc) (map[strin
opts := Options{
IndexDir: dstDir,
RepositoryDescription: ib.repoList[0],

// TODO we should remove these fields from Options and just rely on them
// being set by RepositoryDescription.
TenantID: ib.repoList[0].TenantID,
RepoID: ib.repoList[0].ID,
}

shardName := opts.shardNameVersion(ib.indexFormatVersion, 0)
Expand Down
Loading