Skip to content
This repository has been archived by the owner on Jan 28, 2021. It is now read-only.

Fix filtered index #550

Merged
merged 1 commit into from Nov 15, 2018
Merged

Fix filtered index #550

merged 1 commit into from Nov 15, 2018

Conversation

kuba--
Copy link
Contributor

@kuba-- kuba-- commented Nov 14, 2018

Signed-off-by: kuba-- kuba@sourced.tech

It fixes filtered and negate lookups (in the same way how it was done for regular lookup).
Thanks to this fix we may have intersect lookups with different conditions like: a=1 AND b < 5

@kuba-- kuba-- requested a review from a team November 14, 2018 15:30
@kuba-- kuba-- added the bug Something isn't working label Nov 14, 2018
@@ -241,6 +244,9 @@ func (l *filteredLookup) values(p sql.Partition) (*pilosa.Row, error) {

row = intersect(row, r)
}
if err := l.index.Close(); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

There are several cases where it can return an error and do not reach this line. Does it matter if l.index is not closed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we have to close it when something happen (and it's not because of pilosa, but more because we have reference counting in concurrentPilosaIndex).
But we have to close it asap (after first loop, so we cannot defer here)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jfontan - check it out

Signed-off-by: kuba-- <kuba@sourced.tech>
@ajnavarro ajnavarro merged commit 2da211e into src-d:master Nov 15, 2018
@kuba-- kuba-- deleted the fix-filteredindex branch November 15, 2018 12:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants