Skip to content

Coordinator multi-fetch fixes - #989

Merged
prateek merged 2 commits into
masterfrom
prateek/coordinator-panic-fixes
Sep 30, 2018
Merged

Coordinator multi-fetch fixes#989
prateek merged 2 commits into
masterfrom
prateek/coordinator-panic-fixes

Conversation

@prateek

@prateek prateek commented Sep 30, 2018

Copy link
Copy Markdown
Collaborator

No description provided.

@prateek
prateek force-pushed the prateek/coordinator-panic-fixes branch from 832cfba to 21cefe2 Compare September 30, 2018 02:14
@prateek
prateek force-pushed the prateek/coordinator-panic-fixes branch from 21cefe2 to f88d7b9 Compare September 30, 2018 02:18

for _, iter := range iters {
id := iter.ID().String()
r.dedupeMap[id] = append(r.dedupeMap[id], multiResultSeries{

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.

Cant this panic if the exiting value is a nil slice?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

talked offline, appending to nil slice is kosher

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We're always going to alloc a map and an array per entry in the map now?

if exists && existing.attrs.Resolution <= attrs.Resolution {
// Already exists and resolution of result we are adding is not as precise
func (r *multiResult) dedupe() {
for id, serieses := range r.dedupeMap {

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.

serieses --> seriesList or something

return nil, noop, fmt.Errorf("no namespaces configured")
}

pools, err := namespaces[0].Session().IteratorPools()

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.

maybe leave a todo to find a way where we're not always ignoring pools from the other namespaces

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

talked offline, will comeback for this.

@richardartoul richardartoul left a comment

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.

LGTM

@prateek
prateek merged commit 22b0b4c into master Sep 30, 2018
@prateek
prateek deleted the prateek/coordinator-panic-fixes branch September 30, 2018 03:58
attrs: r.dedupeFirstAttrs,
}
}
r.dedupeMap = make(map[string][]multiResultSeries, len(iters))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hm now we are always going to be making the dedupe map (regardless of if we only hit a single namespace)?

@robskillington

Copy link
Copy Markdown
Collaborator

Thanks for fixing this, I should have had better tests to catch this.

Ignore the comments I posted, I can revisit the perf, to avoid de-dupe map if we don't need it, etc.

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.

3 participants