Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix updating a non unique consumer on workqueue stream not returning …
…an error (#4654) This is a possible fix for #4653. Changes made: 1. Added tests for creating and updating consumers on a work queue stream with overlapping subjects. 2. Check for overlapping subjects before [updating](https://github.com/nats-io/nats-server/blob/a25af02c7348d1e39cce66a5c275e1740fb0ca81/server/consumer.go#L770) the consumer config. 3. Changed [`func (*stream).partitionUnique(partitions []string) bool`](https://github.com/nats-io/nats-server/blob/a25af02c7348d1e39cce66a5c275e1740fb0ca81/server/stream.go#L5269) to accept the consumer name being checked so we can skip it while checking for overlapping subjects (Required for [`FilterSubjects`](https://github.com/nats-io/nats-server/blob/a25af02c7348d1e39cce66a5c275e1740fb0ca81/server/consumer.go#L75) updates), wasn't needed before because the checks were made on creation only. There's only 1 thing that I'm not sure about. In the [current work queue stream conflict checks](https://github.com/nats-io/nats-server/blob/a25af02c7348d1e39cce66a5c275e1740fb0ca81/server/consumer.go#L796), the consumer config `Direct` is being checked if `false`, should we also make this check before the update? Signed-off-by: Pierre Mdawar <pierre@mdawar.dev>
- Loading branch information
Showing
3 changed files
with
89 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters