Commit Graph

2687 Commits

Author SHA1 Message Date
Derek Collison
114431bb3c If a mirror config was removed the reference to mset.mirror.msgs would fail.
This protects against that.

Signed-off-by: Derek Collison <derek@nats.io>
2021-04-07 10:59:05 -07:00
R.I.Pienaar
3e4f6b8e4e Merge pull request #2074 from ripienaar/2073
ensure varz subscriptions consider all accounts
2021-04-07 15:05:51 +02:00
R.I.Pienaar
e24e54c5a3 ensure varz subscriptions consider all accounts
Signed-off-by: R.I.Pienaar <rip@devco.net>
2021-04-07 11:52:09 +02:00
Jaime Piña
e44275b963 Consolidate temporary test files and directories
Currently, temporary test files and directories are written in lots of
different paths within the OS's temp dir. This makes it hard to know
which files are from nats-server and which are unrelated. This in turn
makes it hard to clean up nats-server test files.
2021-04-06 10:42:55 -07:00
Matthias Hanel
3c50623f0c Adding back public error ErrAccountResolverSameClaims
Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-04-06 12:53:19 -04:00
Matthias Hanel
2664e964a8 [fixed] issue with concurrent account fetch when account was incomplete (#2067)
* [fixed] issue with concurrent account fetch when account was incomplete

This happened when a dummy (expired/incomplete) account was created during
a route operation. The dummy was to avoid fetching the account, which would
cause a lock inversion.
When a non route request required the account, we'd download it as it is
set to expired.
A concurrent request would result in ErrAccountResolverSameClaims which
the caller did not handle.
Fix is to remove ErrAccountResolverSameClaims.

Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-04-06 12:43:10 -04:00
Ivan Kozlovic
12a90403fe Merge pull request #2066 from nats-io/ln_cluster_loop_detection
[FIXED] Leafnode: incorrect loop detection in multi-cluster setup
2021-04-06 08:58:17 -06:00
Ivan Kozlovic
21a9bfa1d8 [FIXED] Leafnode: incorrect loop detection in multi-cluster setup
If leafnodes from a cluster were to reconnect to a server in
a different cluster, it was possible for that server to send
to the leafnodes some their own subscriptions that could cause
an inproper loop detection error.

There was also a defect that would cause subscriptions over route
for leafnode subscriptions to be registered under the wrong key,
which would lead to those subscriptions not being properly removed
on route disconnect.

Finally, during route disconnect, the leafnodes map was not updated.
This PR fixes that too.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-04-05 16:49:37 -06:00
alexpantyukhin
84884a93b5 put typestring to map and add tests 2021-04-05 22:03:14 +04:00
Ivan Kozlovic
c2ee75303b Release v2.2.1
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-04-02 16:38:10 -06:00
Ivan Kozlovic
fbaae34e84 Merge pull request #2061 from nats-io/fix_mqtt
[FIXED] MQTT: make sure unsubscribe is propagated
2021-04-02 15:44:34 -06:00
Matthias Hanel
b154c3d957 [Fixed] remote subscription leak for leafnodes caused by auto unsubscribe
Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-04-02 17:38:57 -04:00
Ivan Kozlovic
8a4e1f688a [FIXED] MQTT: make sure unsubscribe is propagated
In error conditions or when replacing an existing sub qos1 to qos0,
we were unsubscribing the NATS subscription, but that would not
have been propagated across the cluster.

Also fixed a flapper

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-04-02 15:30:27 -06:00
Matthias Hanel
edee54b005 [Adding] (fetch) timeout to nats resolver (#2057)
* [Adding] (fetch) timeout to nats resolver

Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-04-02 12:27:02 -04:00
Derek Collison
14793177c5 RC15
Signed-off-by: Derek Collison <derek@nats.io>
2021-04-02 09:09:11 -07:00
Derek Collison
2009578e8d Fix data race
Signed-off-by: Derek Collison <derek@nats.io>
2021-04-02 08:42:37 -07:00
Derek Collison
44ada49b16 During repeated server restarts or failures consumer state could drift between replicas.
We now make sure to sync state of the replicas when a new leader takes over. We also update ack floors regardless of detection on pending list.

Signed-off-by: Derek Collison <derek@nats.io>
2021-04-02 08:20:29 -07:00
Derek Collison
c3ec8d9fb3 Agressive cache expiration was hindering performance when publishing and receiving from a stream concurrently.
Signed-off-by: Derek Collison <derek@nats.io>
2021-04-01 16:32:43 -07:00
Derek Collison
c6bb9b0644 Fix test since we moved from 500 to 404
Signed-off-by: Derek Collison <derek@nats.io>
2021-04-01 07:09:10 -07:00
Derek Collison
bea180d19e Merge pull request #2053 from nats-io/get_msg
Fix for #1976
2021-04-01 05:26:37 -07:00
Matthias Hanel
cd602231ac [Fixed] missing unlock and added a warning trace (#2054)
* [Fixed] missing unlock and added a warning trace

Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-03-31 19:22:19 -04:00
Derek Collison
ceca86a79c Fix for #1976
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-31 11:23:31 -07:00
Matthias Hanel
e390958beb Updated go client for unit tests and fixing test
One test had a race.
For the other one, the updated go client changed the callback used.s

Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-03-30 21:46:39 -04:00
Waldemar Quevedo
5ec0c35afb Fix to authentication revoked test
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2021-03-30 14:19:15 -07:00
Derek Collison
0650b772a9 Fix test, needed prefix
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-30 13:46:03 -07:00
Jaime Piña
6941bb3ade Update Go client in tests 2021-03-30 13:17:34 -07:00
Derek Collison
bb7a8a5f79 Introduced default max ack pending for ack explicit.
Fixed a bug that would introduce performance degradation for durable consumers R>1.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-30 11:47:24 -07:00
Derek Collison
14a826fb60 Check for entries going negative. Shutdown in place on server exit
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-30 11:46:15 -07:00
Matthias Hanel
6ffe9adf97 [added] disconnect of all clients and disable account on remove
Error sent to the client: Account Authentication Expired

Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-03-30 02:24:02 -04:00
Matthias Hanel
c3479d339e [added] ability to remove account jwt using an operator signing key
Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-03-29 23:58:28 -04:00
Ivan Kozlovic
9c036778c0 [FIXED] Websocket: print correct random port instead of 0
When a random port is selected (likely in tests), the banner would
print the port as `0` instead of its real value.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-03-29 16:01:38 -06:00
Derek Collison
874e13f5b9 Merge pull request #2036 from nats-io/fix-race
Guard account client map
2021-03-29 09:25:04 -07:00
Derek Collison
389c3882be Update based on staticcheck update
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-29 07:48:39 -07:00
Derek Collison
5a48369b4b Make sure to not delete streams on bad updates.
If an update was asssigned but failed at the stream group server we would send back the result which would always delete the stream.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-29 07:35:30 -07:00
Derek Collison
327d913ae1 Under rare scenarios we could fail to load, but this should not be a panic.
We should recover on the lines below.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-29 07:34:28 -07:00
Derek Collison
c8d812d805 Release server lock when getting usage
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-27 17:38:57 -07:00
Matthias Hanel
03aee09847 [Added] error when mirror/source stream prefix overlaps with stream subs (#2041)
* [Added] error when mirror/source stream prefix overlaps with stream subs

Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-03-27 14:01:51 -04:00
Matthias Hanel
9f753a2475 [fixed] issue where verify_and_map: true in leaf node config was not used (#2038)
* [fixed] issue where verify_and_map: true in leaf node config was not used

This broke the setup in such a way that any connect relying on this would have failed.
This also fixes an issue where specifying no account did not result in using $G.

Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-03-26 19:24:01 -04:00
Ivan Kozlovic
b17f38e356 [FIXED] Websocket: do not generate empty frames + LN corruption
- It was possible that when the server was sending frames to a
webbrowser, it would send empty frames. While technically not wrong,
prevent that from happening.
- Not copying enqueued buffers could cause corruption with LN+WS.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-03-26 16:17:46 -06:00
Derek Collison
6c702b3b5d RC10
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-26 14:41:09 -07:00
Derek Collison
0f71c260fb Durable consumers with R>1 had performance challenges.
This code changes the way we handle raft based proposals for consumers.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-26 12:53:49 -07:00
Jaime Piña
6095e8f46d Guard account client map 2021-03-26 10:30:16 -07:00
Derek Collison
2d2938239f Bump to RC9
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-26 05:28:23 -07:00
Derek Collison
c564b18482 Protect against negative
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-26 05:28:00 -07:00
Derek Collison
82d2704594 Increase connection timeout to avoid test failures when running whole test suite.
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-26 04:58:30 -07:00
Derek Collison
8f671deb91 Calling out to the storage update should not hold lock.
We had lock inversion with consumers.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-26 04:40:30 -07:00
Derek Collison
2e0c4e8601 Merge pull request #2033 from nats-io/RC8
RC8
2021-03-25 19:25:31 -07:00
Derek Collison
5d6fe9e4b0 Check for subject overlaps after check for pre-existing
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-25 19:00:15 -07:00
Derek Collison
c05ff97d09 Fixes based on PR feedback
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-25 18:09:35 -07:00
Derek Collison
da7b7f9f85 Make sure to configure global account for reload
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-25 18:06:14 -07:00