-
Notifications
You must be signed in to change notification settings - Fork 552
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
Assert collect task is not completed before fall-back to resume #15495
Conversation
abeeff4
to
d8d2eb2
Compare
server/src/main/java/io/crate/execution/engine/collect/CollectTask.java
Outdated
Show resolved
Hide resolved
d8d2eb2
to
e9ba409
Compare
// the collect task is not in a resume-able state | ||
if (collectTask.completionFuture().isDone()) { | ||
throw Exceptions.toRuntimeException(err); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the fall back function must check if the collect task is resume-able before resuming.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like no concrete scenario that will cause this, but could add an assert.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The assertions are only checked when running tests, and the issue was spotted with running cratedb as "blackbox", so I don't think it will benefit, but on the other hand, the assertion seems logical, so it doesn't harm to add it. Although, the collect task is used only in the else part, shouldn't we have the assertion there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you moved it.
e9ba409
to
3c5ca8c
Compare
3c5ca8c
to
c64b297
Compare
c64b297
to
c9a824e
Compare
Summary of the changes / Why this improves CrateDB
crate/server/src/main/java/io/crate/execution/engine/collect/sources/ShardCollectSource.java
Lines 433 to 446 in 571d6c6
batchIteratorFactory.getIterator()
andshardFailureFallbackOrRaise()
both eventually callcollectTask.addSearcher()
with the samesearcherId
(without checking if thesearcherId
is already added) causing theShardCollectContext already added
exception.Checklist
docs/appendices/release-notes/<x.y.0>.rst
for user facing changessql_features
table for user facing changesdocs/appendices/release-notes/<x.y.0>.rst
(E.g. AdminUI)