Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADDED] Support for multi-filter in stream sources #4276

Merged
merged 12 commits into from Aug 1, 2023

Conversation

jnmoyne
Copy link
Contributor

@jnmoyne jnmoyne commented Jun 28, 2023

  • Tests added
  • Branch rebased on top of current main (git pull --rebase origin main)
  • Changes squashed to a single commit (described here)
  • Build is green in Travis CI
  • You have certified that the contribution is your original work and that you license the work to the project under the Apache 2 license

Changes proposed in this pull request:

Adds support for multi-filter (and associated transform destinations) to stream sources

server/stream.go Outdated Show resolved Hide resolved
Fixes a behavior where idempotency of re-defining the same stream more than once (with the same attributes) was broken due to the DeepEqual failing due to the StreamSource struct received from the client app not having a value for the `iname` structure field (as it's internal) but the StreamSource struct return from `mset.config()` would have it set.

Signed-off-by: Jean-Noël Moyne <jnmoyne@gmail.com>
Signed-off-by: Jean-Noël Moyne <jnmoyne@gmail.com>
Signed-off-by: Jean-Noël Moyne <jnmoyne@gmail.com>
Signed-off-by: Jean-Noël Moyne <jnmoyne@gmail.com>
Signed-off-by: Jean-Noël Moyne <jnmoyne@gmail.com>
@jnmoyne jnmoyne force-pushed the jnm/multifilter_stream_sourcing branch from d8b7177 to 7710638 Compare July 7, 2023 19:26
Signed-off-by: Jean-Noël Moyne <jnmoyne@gmail.com>
Allows source SubjectTransformDests to be empty even if FilterSubjects is not empty (no subject transformation)
Clean up duplicated code

Signed-off-by: Jean-Noël Moyne <jnmoyne@gmail.com>
Copy link
Member

@Jarema Jarema left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great feature, but I have some concerns around API structure.

server/stream.go Outdated Show resolved Hide resolved
…string arrays to an array of transform config objects containing two fields

Removes now un-needed error.

Signed-off-by: Jean-Noël Moyne <jnmoyne@gmail.com>
Copy link
Member

@Jarema Jarema left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the transform structures much more! That part looks good for me.
I found a few nits in the code.

server/stream.go Outdated Show resolved Hide resolved
server/stream.go Outdated Show resolved Hide resolved
server/stream.go Outdated Show resolved Hide resolved
Signed-off-by: Jean-Noël Moyne <jnmoyne@gmail.com>
Copy link
Member

@Jarema Jarema left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few more comments.

server/jetstream_test.go Outdated Show resolved Hide resolved
server/stream.go Outdated Show resolved Hide resolved
Signed-off-by: Jean-Noël Moyne <jnmoyne@gmail.com>
Copy link
Member

@Jarema Jarema left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

… creating a stream (expected to be there by one of the nats.go tests)

Signed-off-by: Jean-Noël Moyne <jnmoyne@gmail.com>
…ation as it breaks one of the existing JS test:

```
    jetstream_cluster_2_test.go:998: Expected to have NO domain set but got "SPOKE"
--- FAIL: TestJetStreamClusterDomainsWithNoJSHub (1.32s)
```

Signed-off-by: Jean-Noël Moyne <jnmoyne@gmail.com>
Copy link
Member

@neilalexander neilalexander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jnmoyne jnmoyne merged commit 449b275 into dev Aug 1, 2023
2 checks passed
@jnmoyne jnmoyne deleted the jnm/multifilter_stream_sourcing branch August 1, 2023 17:50
jnmoyne added a commit to nats-io/jsm.go that referenced this pull request Aug 3, 2023
jnmoyne added a commit that referenced this pull request Aug 12, 2023
…am mirror (#4354)

- [X] Tests added
- [X] Branch rebased on top of current main (`git pull --rebase origin
main`)
- [X] Changes squashed to a single commit (described
[here](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html))
 - [x] Build is green in Travis CI
- [X] You have certified that the contribution is your original work and
that you license the work to the project under the [Apache 2
license](https://github.com/nats-io/nats-server/blob/main/LICENSE)

Follow up to #4276 extending to Mirror the full StreamSource
functionality.

---------

Signed-off-by: Jean-Noël Moyne <jnmoyne@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants