Skip to content

lib/logstorage: querying existing duplicate stream fields can panic #1604

Description

@func25

Describe the bug

VictoriaLogs v1.51.0 and earlier can store logs with duplicate stream fields. After upgrading to a version containing #1504, querying this existing data causes a fatal panic because the new validation rejects duplicate stream tag names.

To Reproduce

  1. Start VictoriaLogs v1.51.0 or earlier.
  2. Ingest a log with duplicate stream fields:
curl -H 'Content-Type: application/json' \
  -H 'VL-Stream-Fields: service' \
  --data-binary '{"_msg":"test","service":"foo","service":"bar"}' \
  http://localhost:9428/insert/jsonline
  1. Stop VictoriaLogs and open the same storage with current master.
  2. Run query=*.

VictoriaLogs panics with FATAL: cannot unmarshal StreamTags

Version

Reproduced after upgrading from v1.50.0 to current master. The query panic was introduced by #1504.

Logs

No response

Screenshots

No response

Used command-line flags

No response

Additional information

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions