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

[victorialogs] unexpected stream filter behavior #6302

Open
francisye19 opened this issue May 19, 2024 · 1 comment
Open

[victorialogs] unexpected stream filter behavior #6302

francisye19 opened this issue May 19, 2024 · 1 comment
Assignees
Labels
bug Something isn't working victorialogs

Comments

@francisye19
Copy link

francisye19 commented May 19, 2024

Describe the bug

In some cases, a query of combination of stream filter and logic filter doesn't return expected results.

Ingested log: {"A": "a", "B": "b", "C": "c", "_msg":"message"}, A and B are stream fields, and C is other field
Query: _stream:{A="a"} AND _stream:{B="b"}
Expected: return the ingested log
Actual: return nothing

To Reproduce

test data

echo '{"A": "a", "B": "b", "C": "c", "_msg":"message"}' | curl -XPOST -H 'Content-Type: application/stream+json' --data-binary @- 'http://localhost:9428/insert/jsonline?_stream_fields=A,B'

query results

# query1 - returns nothing(unexpected)
curl -s http://localhost:9428/select/logsql/query --data-urlencode 'query=_stream:{A="a"} AND _stream:{B="b"}'

# query2 - does return the log
curl -s http://localhost:9428/select/logsql/query --data-urlencode 'query=(_stream:{A="a"} AND _stream:{B="b"}) AND C:c'
{"_time":"2024-05-19T12:22:44.691982867Z","_stream":"{A=\"a\",B=\"b\"}","_msg":"message","A":"a","B":"b","C":"c"}

Version

v0.7.0-victorialogs

Logs

No response

Screenshots

No response

Used command-line flags

No response

Additional information

It seems the reason is searchStreamIDs can't get correct streamIDs.

@francisye19 francisye19 added the bug Something isn't working label May 19, 2024
@francisye19
Copy link
Author

Hi, @valyala, PTAL this line. Should initStreamFilters take so.tenantIDs instead of tenantIDs? tenantIDs is set to nil when a common stream filter exists, so tenantIDs is not properly set for stream filters of f(code), therefore streamIDs cannot be collected correctly later(code).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working victorialogs
Projects
None yet
Development

No branches or pull requests

3 participants