Commit Graph

4971 Commits

Author SHA1 Message Date
Derek Collison
d91a0061ed Fix for data race around c.echo
Signed-off-by: Derek Collison <derek@nats.io>
2021-09-16 11:59:52 -07:00
Derek Collison
9918f16914 ConsumerInfo in clustered mode would return not found if assigned but not properly setup with a leader.
This change returns an info in those states now to better support client logic when binding consumers.

Signed-off-by: Derek Collison <derek@nats.io>
2021-09-16 10:56:34 -07:00
Ivan Kozlovic
47359c453e Merge pull request #2533 from nats-io/js_cons_fc_hb
[CHANGED] JetStream: flow control requires heartbeats
2021-09-16 10:20:48 -06:00
Derek Collison
decbae30ae Merge pull request #2535 from nats-io/issue-2528
Allow clustered JetStream to allow duplicate stream creation calls.
2021-09-16 08:49:25 -07:00
Derek Collison
cfbc69b12c Allow clustered JetStream to allow duplicate stream creation like single server mode.
Resolves #2528

Signed-off-by: Derek Collison <derek@nats.io>
2021-09-15 20:18:44 -07:00
Ivan Kozlovic
2f579abf0a Merge pull request #2532 from nats-io/mqtt_add_stream_check
MQTT add test to check for idempotent session stream creation.
2021-09-15 10:37:23 -06:00
Ivan Kozlovic
ec774c9347 MQTT handle idempotent session stream creation.
Creating a stream will become idempotent, so assuming that we
should try to transfer the old session streams only on success
will no longer work.

Added a test that checks that "stream" list is queried only once
which means transfer was attempted only once after the second
cluster restart and new connection.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-09-15 10:15:45 -06:00
Ivan Kozlovic
108d4060ff [CHANGED] JetStream: flow control requires heartbeats
The server will now reject the creation of a push consumer with
flow control if no heartbeat is set.

Resolves #2520

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-09-15 09:50:15 -06:00
Ivan Kozlovic
d6f9a06f05 Merge pull request #2530 from nats-io/mqtt_del_sess
MQTT: delete the session record even on restart with clean flag
2021-09-15 09:01:49 -06:00
R.I.Pienaar
eac12f8dd0 Merge pull request #2531 from ripienaar/err_10154
fix error code for JSStreamHeaderExceedsMaximumErr
2021-09-15 16:29:35 +02:00
R.I.Pienaar
6a5ac92eec fix error code for JSStreamHeaderExceedsMaximumErr
Also checks for gaps in codes

Signed-off-by: R.I.Pienaar <rip@devco.net>
2021-09-15 09:01:03 +02:00
Derek Collison
765d39a2b6 Fix flapping test
Signed-off-by: Derek Collison <derek@nats.io>
2021-09-14 17:47:14 -07:00
Ivan Kozlovic
4cc2677573 MQTT: delete the session record even on restart with clean flag
When a session record exists and is currently not connected, if
the user reconnects with the same client ID but with now the
clean flag set, we are required to clear the state. In earlier
implementation (where we were using a stream per session), we
were not deleting the stream to be created right away. Since now
we just have a message per session, it is ok to delete that
message when clearing the existing session that is going to be
replaced.

Also made apiDispatch execute in place for any connection that
is not ROUTER or GATEWAY.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-09-14 16:33:48 -06:00
Derek Collison
777e3236f1 Merge pull request #2529 from nats-io/ln-js-domains
Fixed a condition where JetStream assets could be created in multiple leafnode domains.
2021-09-14 15:25:20 -07:00
Derek Collison
ebc581012e Fixed a condition where JetStream assets could be created in multiple leafnodes.
Also added in optional Domain to StreamInfo.

Signed-off-by: Derek Collison <derek@nats.io>
2021-09-14 14:17:49 -07:00
Derek Collison
8e4a1b541f Merge pull request #2318 from c0deaddict/feature/systemd-hardening
Add hardened systemd service
2021-09-14 13:23:40 -07:00
Derek Collison
20574ffaad Merge pull request #2526 from nats-io/issue-2525
[FIXED] #2525
2021-09-14 06:41:18 -07:00
Derek Collison
9cdab0682a Bump version
Signed-off-by: Derek Collison <derek@nats.io>
2021-09-13 18:41:12 -07:00
Derek Collison
4cfffc6fa6 We use u16 to encide header len when replicating JetStream messages.
Make sure to error if we exceed that limit.

Signed-off-by: Derek Collison <derek@nats.io>
2021-09-13 18:13:07 -07:00
Derek Collison
6e37b98c8a Merge pull request #2522 from nats-io/fs-compact-mqtt
During compaction the cache may not be loaded completely
2021-09-13 16:27:10 -07:00
Derek Collison
620b56e12f During compaction the cache may not be loaded completely if msg block was lmb (active writing).
This could lead to the filtered subject state being incorrect.

Signed-off-by: Derek Collison <derek@nats.io>
2021-09-13 14:36:50 -07:00
Ivan Kozlovic
6e705c2dec Merge pull request #2519 from nats-io/fix_2510
[FIXED] Websocket: possible panic when decoding CLOSE frame
2021-09-13 14:45:20 -06:00
Ivan Kozlovic
2495180d76 Merge pull request #2518 from nats-io/fail_auth_token_where_not_supported
[FIXED] Report config error if "token" defined for cluster{} and gateway{}
2021-09-13 14:23:25 -06:00
Ivan Kozlovic
8d41daf6ab Updates based on code review
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-09-13 14:06:17 -06:00
Ivan Kozlovic
5c5cc88c1f [FIXED] Report config error if "token" defined for cluster{} and gateway{}
Authentication token has never been supported for cluster and
gateway (and leafnode). There is not even a Token option in
ClusterOpts or GatewayOpts.

However, the parsing of the configuration was not rejecting this
misconfiguration, making users believe that token was used for
authentication.

Documentation will also be fixed since it is reported there that
token is supported, which again, has never been the case.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-09-13 10:21:00 -06:00
Derek Collison
02097dc412 Merge pull request #2517 from andrey-shalamov/fixed-queue-group-memory-leak
[FIXED] memory leak for queue subscription
2021-09-13 07:50:30 -07:00
Andrey Shalamov
8575b334a2 fixed queue group memory leak 2021-09-13 15:22:05 +03:00
Ivan Kozlovic
1727c6061c [FIXED] Websocket: possible panic when decoding CLOSE frame
Resolves #2510

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-09-12 15:35:49 -06:00
Ivan Kozlovic
b3c19b9dd1 Merge pull request #2508 from nats-io/release_2_5_0
Release v2.5.0
2021-09-09 16:04:20 -06:00
Ivan Kozlovic
bc1b3a1884 Release v2.5.0
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-09-09 15:29:53 -06:00
Ivan Kozlovic
a5b016f8ab Merge pull request #2507 from nats-io/mqtt_conn_event
[ADDED] Monitoring: ClientID (for MQTT clients) on connection events
2021-09-09 14:51:05 -06:00
Ivan Kozlovic
0411ba0c03 Changed ClientID to MQTTClient and client_id to mqtt_client
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-09-09 14:34:54 -06:00
Derek Collison
bae93c44ef Merge pull request #2506 from nats-io/issue-2494
Added ability to check if no message exists as a test to store the message.
2021-09-09 12:42:33 -07:00
Ivan Kozlovic
49024a0353 [ADDED] Monitoring: ClientID (for MQTT clients) on connection events
ClientID has been added to various monitoring objects. Also, added
the ability to filter connections on `client_id`.

On auth violation, the proper code was not invoked, which meant
that no disconnect event (with auth reason) would be published.

Resolves #2270

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-09-09 13:34:46 -06:00
Derek Collison
c56c5acd64 Only supply expected last header is seq != 0
Signed-off-by: Derek Collison <derek@nats.io>
2021-09-09 12:23:00 -07:00
Derek Collison
e18a278196 Added ability to check if no message exists as a test to store the message.
Signed-off-by: Derek Collison <derek@nats.io>
2021-09-09 11:41:23 -07:00
Derek Collison
6fa3a0ecc8 Merge pull request #2505 from nats-io/issue-2488-2
[FIXED] #2488
2021-09-09 10:22:50 -07:00
Derek Collison
f75371022d Fix for issue #2488.
When we triggered a filestore msg block compact we were not properly dealing with interior deletes.
Subsequent lookups past the skipped messages would cause an error and stop delivering messages.

Signed-off-by: Derek Collison <derek@nats.io>
2021-09-09 09:53:22 -07:00
Ivan Kozlovic
9e5526cc9d Merge pull request #2501 from nats-io/mqtt_sess_changes
[IMPROVED] MQTT stream per session replaced with single stream
2021-09-08 19:35:29 -06:00
Ivan Kozlovic
ddcc49f88d Updates based on code review
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-09-08 19:13:46 -06:00
Derek Collison
02c792e675 Bump version
Signed-off-by: Derek Collison <derek@nats.io>
2021-09-08 17:47:50 -07:00
Derek Collison
d29acb8bfd Merge pull request #2502 from nats-io/issue-2500
Make sure to suppress dupes on JS deny all for system account
2021-09-08 17:46:49 -07:00
Derek Collison
c841269f71 Make sure to suppress dupes on JS deny all for system account
Signed-off-by: Derek Collison <derek@nats.io>
2021-09-08 17:09:25 -07:00
Ivan Kozlovic
21a990d2b5 [IMPROVED] MQTT stream per session replaced with single stream
With the availability of a "max message per subject" for a given
stream, it is possible to replace individual streams that were
created per session with a single stream that gets all sessions
as a single message per subject, which subject is composed of
the session client ID hash.

The first time the new stream is created for a given account,
all existing MQTT session streams will be transferred to the
new mux'ed MQTT session stream.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-09-08 16:32:41 -06:00
Derek Collison
309856da4e Merge pull request #2499 from nats-io/interest-noack
[FIXED] - Message cleanup for interest stream and no-ack consumers in clustered mode.
2021-09-08 15:30:38 -07:00
Derek Collison
dadc3b9fae Fixed a bug when an interest retention stream with noack consumers is in clustered mode.
We were not properly propagating the ack state and proper cleanup of the stream messages.

Signed-off-by: Derek Collison <derek@nats.io>
2021-09-08 15:02:09 -07:00
Waldemar Quevedo
874c79fe41 Merge pull request #2496 from wallyqs/update-tls-certs
Renew some TLS certs
2021-09-07 13:06:28 -07:00
Waldemar Quevedo
c73163fc13 Renew some TLS certs
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2021-09-07 11:28:00 -07:00
Derek Collison
04e8485a21 Bump version
Signed-off-by: Derek Collison <derek@nats.io>
2021-09-07 08:37:50 -07:00
Derek Collison
963b0c41d7 Merge pull request #2490 from nats-io/fs-stable
Fixed a bug that could lead to perceived message loss under JetStream.
2021-09-07 08:37:16 -07:00