Commit Graph

5971 Commits

Author SHA1 Message Date
Derek Collison
59a0a3ba5c Allow stream and mirror direct get abilities to be updated.
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-08 07:13:34 -07:00
Derek Collison
61fe6bcffb Bump to 2.9.0-beta.5
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-07 17:54:46 -07:00
Derek Collison
85123861d4 Merge pull request #3249 from nats-io/catchup_eof
Fix for stalled catchup in endless cycle on EOF
2022-07-07 17:54:07 -07:00
Matthias Hanel
9c55e67a35 Merge pull request #3248 from nats-io/fix-uniqe-tag-stream-update
Fix unique_tag issue with stream replica increase
2022-07-08 02:23:59 +02:00
Derek Collison
333e2fc2f1 Fix for stalled catchup in endless cycle on EOF trying to retrieve catchup msg.
A customer experienced and endless failure to have a stream cacthup. The current leader was being asked for a message from a snapshot that was larger then what we had, resulting in EOF which silently failed.
We now detect this and signal end of catchup and redo the bad snapshot if possible.

Signed-off-by: Derek Collison <derek@nats.io>
2022-07-07 13:42:41 -07:00
Matthias Hanel
f0ee56cf0a Fix unique_tag issue with stream replica increase
When increasing the replica count unique tags for already existing peers
where ignored, which could lead to bad placement

Signed-off-by: Matthias Hanel <mh@synadia.com>
2022-07-07 21:22:55 +02:00
Ivan Kozlovic
7ab256185e Merge pull request #3038 from nats-io/js_expected_last_seq_zero
[CHANGED] JetStream: accept "Nats-Expected-Last-Sequence" with "0"
2022-07-07 10:36:52 -06:00
Derek Collison
c49d081341 Fix data race
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-07 09:05:50 -07:00
Derek Collison
be789c620d Bump to 2.9.0-beta.4
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-07 08:46:18 -07:00
Ivan Kozlovic
be8734e32b [CHANGED] JetStream: accept "Nats-Expected-Last-Sequence" with "0"
We use to ignore if the seq was 0, but now would treat it as
a requirement that the stream be empty if header is present but
set to 0.

This relates to client PR: https://github.com/nats-io/nats.go/pull/958

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-07-07 09:44:27 -06:00
Derek Collison
b4aaec3417 Also wait on consumer
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-06 21:00:15 -07:00
Derek Collison
05e8d82c50 Allow retries on connect
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-06 20:54:13 -07:00
Derek Collison
69f522cb9f Make sure to clean up client connection
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-06 19:29:32 -07:00
Matthias Hanel
a831185a47 Merge pull request #3234 from nats-io/stream-move-fix-first-commit-only
fixes peer removal, simplifies move, more tests
2022-07-07 03:54:10 +02:00
Matthias Hanel
509eec4baa bump server version to 2.9.0-beta.3
Signed-off-by: Matthias Hanel <mh@synadia.com>
2022-07-07 03:36:19 +02:00
Derek Collison
16f788adce Consumer isFiltered could crash if the stream was a mirror with no direct subjects but it was in interest or workqueue retention mode.
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-07 03:35:41 +02:00
Matthias Hanel
70be4b77f9 fixes peer removal, simplifies move, more tests
Make sure when processing a peer removal that the stream assignment agrees.
When a new leader takes over it can resend a peer removal, and if the stream/consumer really was rescheduled we could remove by accident.

Also need to make sure that when we remove a stream we remove the node as part of the stream assignment.
If we didn't, if the same asset returned to this server we would not start up the monitoring loop.

Simplify migration logic in monitorStream, to be driven by leader only

Improved unit tests

Added failure when server not in peer list

Move command does not require server anymore

Signed-off-by: Matthias Hanel <mh@synadia.com>
2022-07-07 03:32:13 +02:00
Derek Collison
de3a90cbc8 Merge pull request #3247 from nats-io/get_direct_next
Allows direct get to also do get next for subject with starting sequence
2022-07-06 16:46:46 -07:00
Derek Collison
f8939b40bc Do not unsubscribe from direct access on leader stepdown, only stopping.
Also wait for stream to have replicas and leader for test.

Signed-off-by: Derek Collison <derek@nats.io>
2022-07-06 16:20:12 -07:00
Derek Collison
1ea608eabf Allows direct get to also do get next for subject with starting sequence
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-06 14:22:28 -07:00
Derek Collison
94c526f54c Merge pull request #3246 from nats-io/sys_group
Reserve a system queue group
2022-07-06 13:29:08 -07:00
Derek Collison
5690059dac Reserve a system queue group
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-06 13:16:13 -07:00
Ivan Kozlovic
697811cd9b Merge pull request #3242 from nats-io/fix_3239
[ADDED] Symlink for deb/rpm packages
2022-07-06 12:04:50 -06:00
Derek Collison
90caf12d96 Attempt to fix flapping test
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-06 09:11:31 -07:00
Derek Collison
722ae548dd Fix data race
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-06 09:11:22 -07:00
Derek Collison
0c9ed8c10a Bump to 2.9.0-beta.2
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-05 14:01:28 -07:00
Derek Collison
8b7f7effbd Merge pull request #3243 from nats-io/issue_3178
Direct access to JetStream resources when a leafnode connection is down.
2022-07-05 13:58:08 -07:00
Derek Collison
c14fda51e7 Direct access to JetStream resources would be affected if across a leafnode that was down.
This allows a solciting leafnode config to ask that any JetStream cluster assets that are a current leader have the leader stepdown.

Signed-off-by: Derek Collison <derek@nats.io>
2022-07-05 12:35:09 -07:00
Derek Collison
1cc63c023d Merge pull request #3238 from nats-io/mirror_direct
Direct stream access enhancements
2022-07-05 10:38:48 -07:00
Derek Collison
c395fc3c94 Merge pull request #3237 from nats-io/maxprocs
Allow maxprocs to debug log after start banner
2022-07-05 09:49:30 -07:00
Ivan Kozlovic
04c6d6176a [ADDED] Symlink for deb/rpm packages
Since v2.7.4 and due to an update of the goreleaser tool, the
server is now installed under "/usr/bin" instead of "/usr/local/bin".

We keep the install in "/usr/bin" but this PR adds symlink so that
"/usr/local/bin" still points to the nats-server.

Resolves #3239

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-07-05 10:05:04 -06:00
Derek Collison
ea6e258491 Merge pull request #3241 from nats-io/fifo_pull
Make pull consumers FIFO per message, not per request.
2022-07-05 07:02:22 -07:00
Derek Collison
52baa95e2a When stalled for MaxAckPending, expire all pull requests that are one shot, meaning had at least 1 delivered message
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-04 19:14:49 -07:00
Derek Collison
1b580c67f3 Make pull consumers FIFO per message, not per request.
This effectively means that requests with batch > 1 will process a message and go to the end of the line.

Signed-off-by: Derek Collison <derek@nats.io>
2022-07-04 13:05:57 -07:00
Derek Collison
81a9906ad9 Wait a bit longer for the direct sub
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-03 12:54:15 -07:00
Derek Collison
9b7c81c37e Some tests improvements on non-standard JS cluster setup
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-03 12:45:27 -07:00
Derek Collison
47bef915ed Allow all members of a replicated stream to participate in direct access.
We will wait until a non-leader replica is current to subscribe.

Signed-off-by: Derek Collison <derek@nats.io>
2022-07-03 11:08:24 -07:00
Derek Collison
4075721651 Allow direct msg get for stream to operate in queue group and allows mirrors to opt-in to the same group.
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-02 14:16:55 -07:00
Derek Collison
28e846334c Allow maxprocs to debug log after start banner
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-02 08:46:19 -07:00
Derek Collison
7cf814de8e Merge pull request #3236 from ripienaar/json_tag_fix
fix json tag for meta stream move
2022-07-02 08:35:44 -07:00
R.I.Pienaar
97ad346c34 fix json tag for meta stream move
Signed-off-by: R.I.Pienaar <rip@devco.net>
2022-07-02 11:51:50 +02:00
Derek Collison
b7d94e1b52 Merge pull request #3232 from nats-io/leafnode_cluster_same
Close leafnode connection when same cluster name detected
2022-06-30 15:34:40 -07:00
Derek Collison
e6479dafd2 Close leafnode connection when same cluster name detected
Signed-off-by: Derek Collison <derek@nats.io>
2022-06-30 15:34:22 -07:00
Jean-Noël Moyne
e46b00639a Resolves #3151 plus redo and improve subject mapping destination validation and error handling (#3231)
* 1: Allows spaces to be used inside {{}} subject mapping functions:

2: Rework and improve mapping destinations validation and error handling with much more helpful error messages, e.g.:

* Error adding mapping for "foo.*.*" to "bar.{{wildcard(1)}}" : invalid mapping destination: not using all of the token wildcard(s) in bar.{{wildcard(1)}}

* Error adding mapping for "myservice.request.*" to "myservice.request.{{ partition(10) }}.{{wildcard(1)}}" : invalid mapping destination: not enough arguments passed to the function in {{ partition(10) }}

* Error adding mapping for "myservice.request.*" to "myservice.request.{{ partition(10,2) }}.{{wildcard(1)}}" : invalid mapping destination: wildcard index out of range in {{ partition(10,2) }}: [2]

* Error adding mapping for "myservice.request.*" to "myservice.request.{{ partition(10,1) }}.{{wildcard()}}" : invalid mapping destination: not enough arguments passed to the function in {{wildcard()}}

* Error adding mapping for "myservice.request.*" to "myservice.request.{{ xxxpartition(10,1) }}.{{wildcard(1)}}" : invalid mapping destination: unknown function in {{ xxxpartition(10,1) }}

* Error adding mapping for "myservice.request.*" to "myservice. request.{{ xxxpartition(10,1) }}.{{wildcard(1)}}" : invalid mapping destination: invalid subject

* implement PR comments
2022-06-30 14:21:53 -07:00
Derek Collison
8a94e14fe7 Bump to 2.9.0-beta.1
Signed-off-by: Derek Collison <derek@nats.io>
2022-06-29 15:42:11 -07:00
Ivan Kozlovic
3d3b854d72 Merge pull request #3229 from nats-io/pull_inactive_threshold
[FIXED] Pull consumer may be incorrectly removed after InactiveThreshold
2022-06-29 16:40:42 -06:00
Derek Collison
4a94a172c4 Merge pull request #3227 from nats-io/filtered_mirrors
Allow filtered stream mirrors
2022-06-29 15:39:07 -07:00
Matthias Hanel
6bd14e1b7a removed commented out code (#3228)
Signed-off-by: Matthias Hanel <mh@synadia.com>
2022-06-29 20:31:12 +02:00
Matthias Hanel
6e52608936 [added] support for jwt account option DisallowBearer (#3127)
* [added] support for jwt account option DisallowBearer

change 3 out of 3. Fixes #3084
corresponds to:
https://github.com/nats-io/jwt/pull/177
https://github.com/nats-io/nsc/pull/495

update jwt library to 2.3.0

Signed-off-by: Matthias Hanel <mh@synadia.com>
2022-06-29 18:19:14 +02:00
Ivan Kozlovic
c519df7e0d [FIXED] Pull consumer may be incorrectly removed after InactiveThreshold
When creating a pull consumer with InactiveThreshold set, if the
application is doing pull requests with "no_wait" at regular interval
(lower than InactiveThreshold), the JS consumer should be considered
active and not deleted.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-06-29 10:15:09 -06:00