Commit Graph

6099 Commits

Author SHA1 Message Date
Derek Collison
2120be6476 nit: Cap stats
Signed-off-by: Derek Collison <derek@nats.io>
2022-08-05 07:52:23 -07:00
Derek Collison
be54b08afd Bump to 2.9.0-beta.21
Signed-off-by: Derek Collison <derek@nats.io>
2022-08-04 18:01:26 -07:00
Ivan Kozlovic
b80383965a Merge pull request #3338 from nats-io/fix_qunsub_leak
[FIXED] Memory leak when unsubscribing the last queue subscription
2022-08-04 18:59:35 -06:00
Derek Collison
daaaad5eaf Merge pull request #3337 from nats-io/allow-direct-default
On stream create, change AllowDirect set test on MaxMsgsPer to > 0
2022-08-04 17:46:52 -07:00
Ivan Kozlovic
b6208c775b [FIXED] Memory leak when unsubscribing the last queue subscription
A server maintains a map for the subject+queue to know the number
of members on the same group. However, on unsubscribe when we get
to the last one being unsubscribed, we were removing from the map
but then unfortunately adding back with a value of 0, which caused
a leak. If the same subscription was coming back, then this map
entry would be reused, but if it is a never coming back queue sub,
then memory could increase continously.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-08-04 18:42:13 -06:00
Todd Beets
9f8b4461f3 change set test to > 0 2022-08-04 17:37:40 -07:00
Ivan Kozlovic
e03d84f704 Merge pull request #3333 from nats-io/leaf_connect_disabled
Use specific boolean for a leaf test instead of using leafNodeEnabled
2022-08-04 14:33:31 -06:00
Ivan Kozlovic
5bc03c7637 Update leafNodeEnabled value on Start()
Maybe that is the place it could be set and not in NewServer(), but
want to minimize risk of breaking something close to 2.9.0

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-08-04 14:13:35 -06:00
Ivan Kozlovic
d84d9f8288 Use specific boolean for a leaf test instead of using leafNodeEnabled
A test TestJetStreamClusterLeafNodeSPOFMigrateLeaders was added at
some point that needed the remotes to stop (re)connecting. It made
use of existing leafNodeEnabled that was used for GW/Leaf interest
propagation races to disable the reconnect, but that may not be
the best approach since it could affect users embedding servers
and adding leafnodes "dynamically".

So this PR introduced a specific boolean specific for that test.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-08-04 10:00:11 -06:00
Ivan Kozlovic
5df91797d6 Merge pull request #3332 from nats-io/fix_js_cluster_test_name
Fixed JS cluster prefix name for Travis run
2022-08-04 09:45:28 -06:00
Ivan Kozlovic
fe1feeba7d Fixed JS cluster prefix name for Travis run
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-08-04 09:09:52 -06:00
Derek Collison
3aeba043fc Bump to 2.9.0-beta.20
Signed-off-by: Derek Collison <derek@nats.io>
2022-08-04 06:20:10 -07:00
Derek Collison
569380fcae Merge pull request #3329 from nats-io/dg-ln
[FIXED] DirectGet working across leafnodes with JetStream Domains.
2022-08-04 06:19:25 -07:00
Derek Collison
28ccaa4371 Direct get across a leafnode using cross domain mappings to a queue subscriber did not work.
The interest moved across the leafnode would be for the mapping, and not the actual qsub.
So when received if we did detect that we are mapped and do not have a queue filter present make sure to ignore.
This will allow queue subscriber processing on the local server that received the message from the leafnode.

Signed-off-by: Derek Collison <derek@nats.io>
2022-08-03 20:21:28 -07:00
Derek Collison
e52c7cd3da Update client for direct get in KV
Signed-off-by: Derek Collison <derek@nats.io>
2022-08-03 20:20:56 -07:00
Ivan Kozlovic
7d85a84ef9 Merge pull request #3328 from nats-io/js_fail_republish_stream_update
[FIXED] JetStream: reject stream update with changes to RePublish
2022-08-03 17:53:55 -06:00
Ivan Kozlovic
7af963340d Merge pull request #3318 from mprimi/chaos-test-1
Chaos tests for JS cluster
2022-08-03 16:40:29 -06:00
Ivan Kozlovic
b73afbdcb1 [FIXED] JetStream: reject stream update with changes to RePublish
The update was not rejected, yet the republish update was not
taking place.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-08-03 16:37:39 -06:00
Marco Primi
d83e0e2b25 Add 'chaos' test utility and 2 example tests
'Chaos' is a new a group of test that validates behavior in presence of
random failures.

Overview:
 - Introduce a 'Chaos Monkey' controller which can unleash a monkey
against a test cluster.
 - Introduce a monkey of type 'ClusterBouncer' which stops and restarts
nodes according to some configuration
 - Add 2 example tests, they ensure a cluster can survive some amount of
nodes bouncing
 - Configure the build to skip chaos tests unless explicitly requested
 - Add some test utility functions
2022-08-03 14:01:56 -07:00
Marco Primi
b42b0d5a77 Ignore dist and .vscode 2022-08-03 14:01:55 -07:00
Derek Collison
f7387f7762 Bump to 2.9.0-beta.19
Signed-off-by: Derek Collison <derek@nats.io>
2022-08-03 13:00:07 -07:00
Derek Collison
377ed4c365 Merge pull request #3327 from nats-io/direct-auto
Auto-set and upgrade AllowDirect when MaxMsgsPerSubject is set.
2022-08-03 12:59:31 -07:00
Derek Collison
748890adb1 Auto-set and upgrade AllowDirect when MaxMsgsPerSubject is set.
Also allow mirrors to inherit properly.

Signed-off-by: Derek Collison <derek@nats.io>
2022-08-03 12:36:52 -07:00
Derek Collison
d7847c97c1 Bump to 2.9.0-beta.18
Signed-off-by: Derek Collison <derek@nats.io>
2022-08-03 08:07:12 -07:00
Derek Collison
f45454b5a4 Merge pull request #3325 from nats-io/dg-perms
Allow direct get by subject to be all subject based.
2022-08-03 08:04:41 -07:00
Ivan Kozlovic
22b91238f3 Merge pull request #3323 from nats-io/js_raft_move_warn_to_debug
Downgrade a RAFT warning to debug
2022-08-03 08:52:52 -06:00
Matthias Hanel
ed2cb280cc Move to crypto/rand for nonce generation (#3324)
Signed-off-by: Matthias Hanel <mh@synadia.com>
2022-08-03 06:52:26 +02:00
Derek Collison
c82c49451c Allow direct get by subject to be all subject based.
This avoids marshalling or unmarshalling but also allows subject based permissioning.

Signed-off-by: Derek Collison <derek@nats.io>
2022-08-02 18:19:33 -07:00
Ivan Kozlovic
37c923c28e Downgrade a RAFT warning to debug
This is related to PR #3307.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-08-02 18:06:39 -06:00
Derek Collison
8ae0757e91 Merge pull request #3320 from nats-io/kv_improvements
[IMPROVED] Speed of storing new keys with a large number of pre-existing keys.
2022-08-02 09:15:06 -07:00
Derek Collison
6450301cfc Improved speed of storing new messages when lots of messages are present in KV mode.
Signed-off-by: Derek Collison <derek@nats.io>
2022-08-01 14:02:19 -07:00
Derek Collison
903a06a5b4 Bump to 2.9.0-beta.17
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-31 11:44:15 -07:00
Ivan Kozlovic
b6b746095b Merge pull request #3315 from nats-io/fix_3313
[FIXED] MQTT: Possible panic when clients misbehave
2022-07-31 12:43:28 -06:00
Derek Collison
588a8fcca9 Merge pull request #3314 from nats-io/enc_dsnap_bug
[FIXED] Instability with encrypted systems
2022-07-31 11:43:17 -07:00
Ivan Kozlovic
6460519cf5 [FIXED] MQTT: Possible panic when clients misbehave
If a client with a given client ID is connected and while connected
another client tries to reuse the same client ID, the spec says that
the old client be closed and the new one accepted.
However, the server protects from this flapping happening all the time
by rejecting new clients that try to connect at a very fast pace.

However, the server was closing a misbehaving client after a second
delay (to prevent immediate reconnect if the client library does that)
but was not blocking the read loop and the compounding issue was that
if that misbehaving client is REALLY misbehaving and not waiting for
the CONNACK to send more protocols (for instance SUB) the server would
panic because the client was not fully configured.

To prevent that, the server will now "block" this misbehaving client
in its readLoop before closing the connection, preventing processing
of possible protocols that follow the CONNECT.

Resolves #3313

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-07-31 12:20:38 -06:00
Derek Collison
717969510d Make sure to reset block encryption counter when clearing block but holding state for tracking sequences.
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-31 07:59:19 -07:00
Derek Collison
8dc1e4b6de When compact would reclaim head of block space, we needed to update block key for counter for new writes.
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-30 13:05:41 -07:00
Ivan Kozlovic
32ffc0257b Merge pull request #3311 from nats-io/fix_nightly_docker
Replace "go get" with "go install"
2022-07-29 17:25:18 -06:00
Ivan Kozlovic
f397e15896 Replace "go get" with "go install"
[ci skip]

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-07-29 17:23:58 -06:00
Ivan Kozlovic
05a7aaff45 Merge pull request #3310 from nats-io/update_nightly_go_version
Update nightly to Go 1.18
2022-07-29 17:17:50 -06:00
Derek Collison
e4ef3e4b09 Bump to 2.9.0-beta.16
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-29 16:16:14 -07:00
Derek Collison
5dfa7dcb40 Merge pull request #3309 from nats-io/remove_panic
General stability improvements
2022-07-29 16:15:52 -07:00
Ivan Kozlovic
ab1b86ef96 Update nightly to Go 1.18
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-07-29 17:15:12 -06:00
Derek Collison
5e98263de8 General stability improvements
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-29 16:02:31 -07:00
Ivan Kozlovic
465db58b44 Merge pull request #3302 from bruth/update-max-waiting
[FIXED] Reject update of pull consumer MaxWaiting since it is not supported
2022-07-29 13:14:44 -06:00
Byron Ruth
095cfef9eb Add check and test to prevent updating consumer MaxWaiting
Signed-off-by: Byron Ruth <b@devel.io>
2022-07-29 15:05:00 -04:00
Derek Collison
8aee7d5e51 Bump to 2.9.0-beta.15
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-29 09:30:07 -07:00
Derek Collison
43871300a3 Merge pull request #3308 from nats-io/encrypt_updates
Encrypt meta and raft states.
2022-07-29 09:25:55 -07:00
Derek Collison
259d1a1b9e Merge pull request #3307 from nats-io/raft_improvements
Improvements to raft layer with snapshots on catchup.
2022-07-29 09:12:24 -07:00
Derek Collison
27d87a68a4 Improvements to raft layer with snapshots on catchup.
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-29 09:01:03 -07:00