Skip to content

lib/logstorage: duplicate stream fields can panic during ingestion #1603

Description

@func25

Describe the bug

VictoriaLogs v1.51.0 and earlier can store logs with duplicate stream fields. After #1504, MustAdd still allows these duplicates, but the validation later panics when single-node VictoriaLogs registers the stream.

The problem is that cluster mode behaves differently, vlstorage drops the row in MustAddInsertRow instead of panicking. MustAdd should reject duplicate stream fields consistently with MustAddInsertRow before passing them to storage.

To Reproduce

Run current master in single-node mode, then send:

curl -H 'Content-Type: application/json' \
  -H 'VL-Stream-Fields: service' \
  --data-binary '{"_msg":"test","service":"foo","service":"bar"}' \
  http://localhost:9428/insert/jsonline

Version

master

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