lib/logstorage: reject unquoted filter values using function names - #1711
lib/logstorage: reject unquoted filter values using function names#1711angelofallars wants to merge 6 commits into
Conversation
6deab47 to
28d0464
Compare
| f(`''`, `""`) | ||
|
|
||
| // reserved functions | ||
| f("eq_field", `"eq_field"`) |
There was a problem hiding this comment.
These tests must be rewritten for testing how the parser parses quoted function names.
There was a problem hiding this comment.
Good callout, I will add unit tests to ensure quoted function names are parsed successfully
There was a problem hiding this comment.
Addressed in 5c9abcd, added tests for successful parsing of quoted function names for every reserved function keyword
| * BUGFIX: [cluster version](https://docs.victoriametrics.com/victorialogs/cluster/): evenly spread rerouted data across available `vlstorage` nodes. Previously, healthy nodes adjacent to unavailable nodes in the `-storageNode` list could receive much more data, resulting in uneven resource usage. See [#1548](https://github.com/VictoriaMetrics/VictoriaLogs/issues/1548). | ||
| * BUGFIX: [data ingestion](https://docs.victoriametrics.com/victorialogs/data-ingestion/) and [querying](https://docs.victoriametrics.com/victorialogs/querying/): properly handle logs containing duplicate [stream field](https://docs.victoriametrics.com/victorialogs/keyconcepts/#stream-fields) names. Previously, [v1.52.0](https://github.com/VictoriaMetrics/VictoriaLogs/releases/tag/v1.52.0) could panic when ingesting such logs in single-node VictoriaLogs, drop them during ingestion in VictoriaLogs cluster, or panic when querying such data written by earlier releases. See [#1603](https://github.com/VictoriaMetrics/VictoriaLogs/issues/1603) and [#1604](https://github.com/VictoriaMetrics/VictoriaLogs/issues/1604). | ||
| * BUGFIX: [LogsQL](https://docs.victoriametrics.com/victorialogs/logsql/): fix [`week_range[Sun,Sun]` filter](https://docs.victoriametrics.com/victorialogs/logsql/#week-range-filter) when it is used inside the [`filter` pipe](https://docs.victoriametrics.com/victorialogs/logsql/#filter-pipe). Previously, it could fail to match rows on Sunday. See [#1335](https://github.com/VictoriaMetrics/VictoriaLogs/issues/1335). | ||
| * BUGFIX: [LogsQL](https://docs.victoriametrics.com/victorialogs/logsql/): reject unquoted field names and filter values starting with built-in filter function names such as `exact`, `ipv6_range` and `range`, consistently with `in`, which already requires quoting. Previously, such names were accepted as phrase filters instead of returning an error that they must be quoted. See [#1711](https://github.com/VictoriaMetrics/VictoriaLogs/pull/1711). |
There was a problem hiding this comment.
The changelog entry must link to the corresponding issue, not to the pull request. The initial message in the pull request must point to the corresponding issue, so the issue is automatically back linked to the pull request.
There was a problem hiding this comment.
Ah didn't quite catch that as I couldn't find a "changelog process" doc, will link to the issue instead
There was a problem hiding this comment.
Addressed in 03b98de, links to the issue instead of the PR
|
@valyala thanks for the review! I will address the review comments today and re-request review when I have free time (busy with work rn 😅) |
There was a problem hiding this comment.
All reported issues were addressed across 3 files (changes from recent commits).
Tip: cubic used a learning from your PR history. Let your coding agent read cubic learnings directly with the cubic MCP.
Re-trigger cubic
Fixes #1457
Makes LogsQL reject unquoted filter values if they match a built-in filter function name like
ipv6_rangeorfield:ipv6_range.The error message tells users to put the value or field name in quotes:
the "<func_name>" must be put in quotes.These names will now be rejected when unquoted and not used as a function call:
eq_fieldexactiipv4_rangeipv6_rangejson_array_contains_anyle_fieldlen_rangelt_fieldpattern_matchpattern_match_fullpattern_match_prefixpattern_match_suffixrangereseqstring_rangevalue_typeAdditionally,
contains_common_caseandequals_common_casewere already being rejected when used without quotes but their error message has been modified to match the other values for consistency.Checklist