Skip to content

Deduplication MsgId are not deleted during Purge operation #6782

@funkye

Description

@funkye

Observed behavior

We have a stream with deduplication. When we publish messages with different MsgIds and a specific subject, then call Purge on the subject, Nats server info says that there are 0 messages in the stream, but next messages with the same MsgIds are not published due to deduplication. Also, with long-term use of deduplication and Purge operations, it is noticeable that the memory consumed by the server increases, even with a small number of remaining messages. After restarting the server, the memory stabilizes and deduplication does not work on deleted messages ids.

Expected behavior

After cleaning messages with Purge operation, we can publish messages with MsgIds of deleted messages. Memory from storing MsgIds should be cleared when messages are deleted.

Server and client version

Tested server versions: 2.10.7, 2.10.18, 2.10.27, 2.11.1
.NET client version: 2.5.8

Host environment

Windows 11

Steps to reproduce

  1. Publishing a message with a given subject and MsgId to a stream with the deduplication window enabled.
  2. Cleaning the stream for a given subject.
  3. Republishing the message with the same parameters.

Metadata

Metadata

Labels

defectSuspected defect such as a bug or regressionstaleThis issue has had no activity in a while

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions