Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow SHOW SERIES kill #9586

Merged
merged 1 commit into from
Mar 15, 2018
Merged

Allow SHOW SERIES kill #9586

merged 1 commit into from
Mar 15, 2018

Conversation

benbjohnson
Copy link
Contributor

Previously, large SHOW SERIES queries would block until merging was complete before being interrupted. Interruption checks have been added to the iterator and the merge loop. I also tried adding interruption checks to the sort phase but it's difficult to break out of sort.Sort() upon interruption.

@ghost ghost assigned benbjohnson Mar 15, 2018
@ghost ghost added the review label Mar 15, 2018
@benbjohnson benbjohnson requested a review from jsternberg March 15, 2018 19:50
@jsternberg jsternberg changed the title Allow SHOW SERIES kill. Allow SHOW SERIES kill Mar 15, 2018
Copy link
Contributor

@stuartcarnie stuartcarnie left a comment

Choose a reason for hiding this comment

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

The change I made to Shards#CreateIterator will also need to wrap the SeriesPointIterator in an InterruptIterator

@stuartcarnie
Copy link
Contributor

stuartcarnie commented Mar 15, 2018

@benbjohnson would this also need to be wrapped?

influxdb/tsdb/shard.go

Lines 1254 to 1274 in 7b1c0e7

func (a Shards) createSeriesIterator(ctx context.Context, opt query.IteratorOptions) (_ query.Iterator, err error) {
var (
idxs = make([]Index, 0, len(a))
sfile *SeriesFile
)
for _, sh := range a {
var idx Index
if idx, err = sh.Index(); err == nil {
idxs = append(idxs, idx)
}
if sfile == nil {
sfile, _ = sh.seriesFile()
}
}
if sfile == nil {
return nil, errors.New("createSeriesIterator: no series file")
}
return NewSeriesPointIterator(IndexSet{Indexes: idxs, SeriesFile: sfile}, opt)
}

@benbjohnson
Copy link
Contributor Author

@stuartcarnie I don't think that section needs to be wrapped. I believe it gets wrapped by SELECT.

@benbjohnson benbjohnson merged commit 5bd29a0 into master Mar 15, 2018
@ghost ghost removed the review label Mar 15, 2018
@benbjohnson benbjohnson deleted the bj-interrupt-show-series branch March 15, 2018 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants