Commit Graph

5748 Commits

Author SHA1 Message Date
Matthias Hanel
bd2883122e [added] support for jwt operator option DisallowBearerToken
I modified an existing data structure that held a similar attribute already.
Instead this data structure references the claim.

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

Signed-off-by: Matthias Hanel <mh@synadia.com>
2022-04-29 14:18:11 -04:00
Derek Collison
0bb7abccba Bump to 2.8.2-beta.4
Signed-off-by: Derek Collison <derek@nats.io>
2022-04-29 09:21:45 -07:00
Derek Collison
806877ebaa Merge pull request #3090 from nats-io/qsub-deny
Combined canSubscribe and canQueueSubscribe
2022-04-29 09:20:57 -07:00
Derek Collison
c20b52251b Combined canSubscribe and canQueueSubscribe for consistency in specialized deny clause handling.
Signed-off-by: Derek Collison <derek@nats.io>
2022-04-29 09:18:45 -07:00
Derek Collison
ea6a43ead9 Merge pull request #3088 from nats-io/tr-fix
Fix for subject transforms and JetStream delivery subjects.
2022-04-28 17:08:00 -07:00
Derek Collison
e0f5fcffb8 Fix for subject transforms and JetStream delivery subjects.
Signed-off-by: Derek Collison <derek@nats.io>
2022-04-28 15:50:28 -07:00
Derek Collison
0d928c0338 Merge pull request #3085 from nats-io/small-fss-improvement
Small improvement with fss processing
2022-04-28 13:56:53 -07:00
Ivan Kozlovic
5b8c917987 Merge pull request #3087 from nats-io/fix_fs_compact_and_write_index
[FIXED] JetStream: file store compact and when to write index
2022-04-28 14:55:56 -06:00
Ivan Kozlovic
d4d37e67f4 [FIXED] JetStream: file store compact and when to write index
When deciding to compact a file, we need to remove from the raw
bytes the empty records, otherwise, for small messages, we would
end-up calling compact() too many times.

When removing a message from the stream, in FIFO cases we would
write the index every 2 seconds at most when doing it in place,
when when dealing with out of order deletes, we would do it for
every single delete, which can be costly. We are now writing
only every 500ms for non FIFO cases.

Also fixed some unrelated code:
- Decision to install a snapshot was based on incorrect logical
expression
- In checkPending(), protect against the timer being nil which
could happen when consumer is stopped or leadership change.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-04-28 12:35:19 -06:00
Derek Collison
9a96bef4c7 Small improvement with fss processing
Signed-off-by: Derek Collison <derek@nats.io>
2022-04-28 10:23:30 -07:00
Derek Collison
2b1c3374a5 Bump to 2.8.2-beta.2
Signed-off-by: Derek Collison <derek@nats.io>
2022-04-27 08:35:56 -07:00
Derek Collison
5368b660dc Merge pull request #3081 from nats-io/kv-mem-perf
[IMPROVED] KV memory store performance
2022-04-27 08:35:04 -07:00
Matthias Hanel
d520a27c36 [fixed] step down timing, consumer stream seqno, clear redelivery (#3079)
Step down timing for consumers or streams.
Signals loss of leadership and sleeps before stepping down.
This makes it less likely that messages are being processed during step
down.

When becoming leader, consumer stream seqno got reset,
even though the consumer existed already.

Proper cleanup of redelivery data structures and timer

Signed-off-by: Matthias Hanel <mh@synadia.com>
2022-04-27 03:32:08 -04:00
Derek Collison
138034b3a1 For memory store KV with history of 1 we were scanning for our next first when we did not have to.
Signed-off-by: Derek Collison <derek@nats.io>
2022-04-26 19:55:47 -07:00
Derek Collison
981385401a Merge pull request #3080 from nats-io/hz-consumer-recovery
Fix for a consumer recovery issue and update to healthz.
2022-04-26 19:41:25 -07:00
Derek Collison
f702e279ab Fix for a consumer recovery issue.
Also update healthz to check all assets that are assigned, not just running.

Signed-off-by: Derek Collison <derek@nats.io>
2022-04-26 19:22:19 -07:00
Ivan Kozlovic
d056e3107e Merge pull request #3078 from nats-io/travis_test_changes
Changes to tests that run on Travis
2022-04-26 17:01:39 -06:00
Ivan Kozlovic
06ff4b2b29 Split JS cluster and super clusters tests and compile only on 1.16
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-04-26 16:24:05 -06:00
Ivan Kozlovic
0e2ab5eeea Changes to tests that run on Travis
- Remove code coverage from Travis and add it to a GitHub Action
that will be run as a nightly.
- Use tag builds to exclude some tests, such as the "norace" or
JS tests. Since "go test" does not support "negative" regexs, there
is no other way.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-04-26 14:11:31 -06:00
R.I.Pienaar
1a80b2e716 Merge pull request #3074 from Coffeeri/feature/nak-advisory
Implement JSConsumerDeliveryNakAdvisory
2022-04-26 08:11:59 -04:00
Leander Kohler
966d9d56f4 Add JSConsumerDeliveryNakAdvisory
The advisory `JSAdvisoryConsumerMsgNakPre` will be triggered
when a message is naked
2022-04-25 16:13:32 +02:00
Ivan Kozlovic
646b3850bf Bump version to 2.8.2-beta
Following recommendations to push to a new version as soon as
we release.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-04-21 15:50:08 -06:00
Ivan Kozlovic
23b41bb624 Merge pull request #3068 from nats-io/release_2_8_1
Release v2.8.1
2022-04-21 15:02:09 -06:00
Ivan Kozlovic
dcfd52413e Release v2.8.1
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-04-21 14:28:12 -06:00
Ivan Kozlovic
99f1bdf1d8 Bump version to 2.8.1-beta.1
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-04-21 11:28:24 -06:00
Ivan Kozlovic
f4115b6864 Merge pull request #3067 from nats-io/js_fix_mirror_dedup
[FIXED] JetStream: Mirrors would fail to be recovered
2022-04-21 11:27:04 -06:00
Ivan Kozlovic
243851af54 Merge pull request #3065 from pgvishnuram/main
fix for CVE-2022-27191
2022-04-21 11:00:31 -06:00
Ivan Kozlovic
363849bf3a [FIXED] JetStream: Mirrors would fail to be recovered
This is a continuation of PR #3060, but extends to clustering.

Verified with manual test that a mirror created with v2.7.4 has
the duplicates window set and on restart with main would still
complain about use of dedup in cluster mode. The mirror stream
was recovered but showing as R1.
With this fix, a restart of the cluster - with existing data -
will properly recover the stream as an R3 and messages that
were published while in a bad state are synchronized.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
Signed-off-by: Matthias Hanel mh@synadia.com
2022-04-21 10:59:23 -06:00
Ivan Kozlovic
e3eb25d2a1 Merge pull request #3066 from nats-io/js_fix_stream_mirror
[FIXED] JetStream: stream mirror issues in mixed mode clusters
2022-04-20 23:22:25 -06:00
Ivan Kozlovic
b9463b322f [FIXED] JetStream: stream mirror issues in mixed mode clusters
Similar to PR #3061

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-04-20 23:21:15 -06:00
Ivan Kozlovic
df61a335c7 Merge pull request #3061 from nats-io/js_fix_stream_source
[FIXED] JetStream: stream sources issue in mixed mode clusters
2022-04-20 23:20:41 -06:00
pgvishnuram
5cc4d0ca4a fix for CVE-2022-27191
* our CVE scanner has detected crypto go module vulnerability in nats exporter this PR fixes that issue by updating the module version
2022-04-21 10:19:35 +05:30
Ivan Kozlovic
9975a38c6e [FIXED] JetStream: stream sources issue in mixed mode clusters
The main issue was that in mixed-mode, the interest through gateway
may still be in optimistic mode, which when creating the source
consumer would start delivery before we had a chance to setup
the subscription to receive those messages.

The approach is to create the subscription prior to sending
the consumer create request. Also refactored a bit the code in
the hope to make the retries a bit more bullet proof.

We may also look at making sure that gateways are switched to
interest-mode when detecting a mixed-mode setup.

Also fixed a defect that could cause a source to be canceled
when updating a stream.

Resovles #2801

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-04-20 21:02:35 -06:00
Matthias Hanel
254c970876 Fix subject renaming for leaf connections and queue subs (#3062)
* [fix] on queue sub, a consumers  delivery subject, was not changed

to the original publish subject the stream received
the code added is a copy of what regular subs do

* [fixed] subject renaming for leaf node connections as well

also updated multi server test to test for queue and non queue scenarios

Signed-off-by: Matthias Hanel <mh@synadia.com>
2022-04-20 19:23:21 -04:00
Matthias Hanel
9db2e91403 Fixes issue on restart where mirror config was invalid (#3060)
This issue was introduced by a bug that assigned a de dupe default value
do mirrors.
This is an invalid config that used to be checked on stream create.
Subsequently this logic was moved and then got executed on startup.
Ending up checking mirrors that got the bad default assigned.
Fix is to clear de dupe window for mirrors

Signed-off-by: Matthias Hanel <mh@synadia.com>
2022-04-20 13:58:30 -04:00
Matthias Hanel
ff5d60973d introducing max_age/dupe_window minimum value of 100ms. (#3056)
Signed-off-by: Matthias Hanel <mh@synadia.com>
2022-04-20 13:58:19 -04:00
Derek Collison
e2ab9d7cb4 Merge pull request #3059 from nats-io/move-fix
Polling too quickly could make migration fail.
2022-04-20 09:36:09 -07:00
Derek Collison
9f9732ad97 When we polled too quickly on migration we could check before catchup logic had even kicked in.
Signed-off-by: Derek Collison <derek@nats.io>
2022-04-20 16:56:18 +01:00
Ivan Kozlovic
d15d04be98 Merge pull request #3058 from nats-io/fix_3009_2
[FIXED] LeafNode: propagation interest issue after a config reload
2022-04-20 08:42:33 -06:00
Ivan Kozlovic
730d8921e4 [FIXED] LeafNode: propagation interest issue after a config reload
When a configuration reload is done, the account's leaf node connections
were not transfered to the new instance of the account, causing the
interest to not be propagated until a leafnode reconnect or a server
restart.

Resolves #3009

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-04-20 08:03:34 -06:00
Ivan Kozlovic
69ea1ab5f4 Bump version
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-04-18 16:36:33 -06:00
Ivan Kozlovic
90721ee1fa Merge pull request #3054 from nats-io/release_2_8_0
Release v2.8.0
2022-04-18 16:28:34 -06:00
Ivan Kozlovic
38bbc6cb72 Release v2.8.0
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-04-18 16:21:31 -06:00
Ivan Kozlovic
ddd31b1988 Merge pull request #3022 from LaurensVergote/Windows
Allow nats-server to run as system user on Windows
2022-04-18 14:33:32 -06:00
Ivan Kozlovic
ca63b206f1 Bump version to 2.8.0-beta.23
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-04-18 14:04:42 -06:00
Ivan Kozlovic
6d71937ba7 Merge pull request #3053 from nats-io/js_add_file_names
[IMPROVED] JetStream: add file names for invalid checksums
2022-04-18 14:00:15 -06:00
xieyuschen
322115be31 [fixed] On config reload js got disabled, when previously set via command line arg
fixes #3003
2022-04-18 15:58:10 -04:00
Ivan Kozlovic
af1a80d7c4 Merge pull request #3047 from nats-io/move-back
If we moved a stream back to a cluster we were once at, the stream would be empty.
2022-04-18 13:46:05 -06:00
Ivan Kozlovic
2659b30113 [IMPROVED] JetStream: add file names for invalid checksums
On restart, we report when we find error in checksums, but we
did not report the name of the file.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-04-18 13:35:08 -06:00
Ivan Kozlovic
1178b4ced7 Merge pull request #3052 from nats-io/js_sources_issues
[FIXED] JetStream: some stream SOURCE issues
2022-04-18 13:15:52 -06:00