nats-io / nats-streaming-server

NATS Streaming System Server
https://nats.io
Apache License 2.0
2.51k stars 284 forks source link

[CHANGED] Reject channels with different case (Foo vs foo) #1274

Closed kozlovic closed 2 years ago

kozlovic commented 2 years ago

Due to the way channels are stored to persistent storage, the first spelling of a channel caused that channel to be persisted under that name. If an application later publishes/subscribes to the same channel but with a different case (say first "Foo" then "foo"), the server would treat it as a new channel but would still store data in the first "Foo" channel, causing message sequences to be reset and inability to consume after a server restart.

From now on, the server will reject published messages or new subscriptions if it detects that a similar channel already exists with a different "case".

Resolves #1265

Signed-off-by: Ivan Kozlovic ivan@synadia.com

coveralls commented 2 years ago

Coverage Status

Coverage decreased (-0.1%) to 91.44% when pulling 497a6a03ae6c87d64352338fa87136fd8f29d943 on fix_1265 into 432ad7c6c46682c6599d6ffa989afacee87be56c on main.