Commit Graph

3309 Commits

Author SHA1 Message Date
Derek Collison
f8a8367ed2 Merge pull request #2615 from nats-io/raft-meta
Improvements to meta raft layer around snapshots and recovery.
2021-10-12 08:46:27 -07:00
Derek Collison
8951bc54f4 Fix for stream purge where purge would remove all pending messages for a filtered consumer.
Signed-off-by: Derek Collison <derek@nats.io>
2021-10-12 07:26:13 -07:00
Derek Collison
bbffd71c4a Improvements to meta raft layer around snapshots and recovery.
Signed-off-by: Derek Collison <derek@nats.io>
2021-10-12 05:53:52 -07:00
dtest1
1075206ce0 rename param: close id golang builtin func name , mislead 2021-10-12 08:18:56 +08:00
Derek Collison
5e1276c27e Bump version
Signed-off-by: Derek Collison <derek@nats.io>
2021-10-11 08:51:28 -07:00
Derek Collison
10a96b8b02 Merge pull request #2606 from nats-io/raft-enc-dec
Added more robust checking for decoding append entries.
2021-10-11 08:47:42 -07:00
dtest1
0937b848cd fix go doc: DenyRules 2021-10-11 23:19:56 +08:00
Derek Collison
1a4410a3f7 Added more robust checking for decoding append entries.
Allow a buffer to be passed in to relive GC pressure.

Signed-off-by: Derek Collison <derek@nats.io>
2021-10-09 09:37:03 -07:00
Derek Collison
9efa11ba43 Don't make consumers go backwards on purge
Signed-off-by: Derek Collison <derek@nats.io>
2021-10-07 07:06:52 -07:00
R.I.Pienaar
e73cddc2de error when a stream requesting rollups deny purge
Signed-off-by: R.I.Pienaar <rip@devco.net>
2021-10-07 14:07:10 +02:00
Ivan Kozlovic
208146aade Merge pull request #2598 from nats-io/fix_2587
[IMPROVED] MQTT: add client id to client connection string
2021-10-06 13:12:55 -06:00
Ivan Kozlovic
25647a1fda [IMPROVED] MQTT: add client id to client connection string
This way, any log statement for a client will include the client id,
similar to how the server now logs information about NATS clients
(such as language, version, connection name).

Also adding a debug statement once the client has successfully connected.

Here is how this will look like for a client with client id "client_0".
```
[69591] 2021/10/06 10:06:50.837977 [DBG] [::1]:57415 - mid:18 - Client connection created
[69591] 2021/10/06 10:06:50.839871 [DBG] [::1]:57415 - mid:18 - "client_0" - Client connected
[69591] 2021/10/06 10:07:00.627307 [DBG] [::1]:57415 - mid:18 - "client_0" - Client connection closed: Client Closed
```
All log statements will be affected, for instance here is an auth error:
```
[69591] 2021/10/06 10:09:48.618964 [DBG] [::1]:57424 - mid:23 - Client connection created
[69591] 2021/10/06 10:09:48.619015 [ERR] [::1]:57424 - mid:23 - "client_0" - authentication error - User "mqtt"
[69591] 2021/10/06 10:09:48.619026 [DBG] [::1]:57424 - mid:23 - "client_0" - Client connection closed: Authentication Failure
[69591] 2021/10/06 10:09:48.619038 [ERR] [::1]:57424 - mid:23 - "client_0" - unable to connect: authentication error
```

Resolves #2587

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-10-06 10:59:50 -06:00
Derek Collison
3f12216fcc Merge pull request #2595 from nats-io/stream-perms
In addition to sealed we add in other stream perms to control purge, msg deletes and rollups.
2021-10-06 07:55:08 -07:00
Derek Collison
1b7e184c9e Update rollup based on feedback
Signed-off-by: Derek Collison <derek@nats.io>
2021-10-06 07:18:46 -07:00
Derek Collison
58e5c7c681 Allow consumers to request only headers to be delivered
Signed-off-by: Derek Collison <derek@nats.io>
2021-10-05 18:54:52 -07:00
Derek Collison
aff0f62106 In addition to sealed we add in other stream perms to control purge, msg deletes and rollups.
Signed-off-by: Derek Collison <derek@nats.io>
2021-10-05 17:43:24 -07:00
Derek Collison
df2147bc7c Fix for rollups and filtered purge
Signed-off-by: Derek Collison <derek@nats.io>
2021-10-04 10:01:36 -07:00
Ivan Kozlovic
d34b8fdd7d [FIXED] JetStream: data race on shutdown
Replaced use of eventsEnabled() with EventsEnabled() that will
check under server lock. Also found another reference when
creating templates.

Resolves #2588

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-09-30 11:17:12 -06:00
Derek Collison
c062190b0a Rollup functionality.
Messages published with the rollup header will place the new message onto the stream and purge all others based on subject, or the complete stream.

Signed-off-by: Derek Collison <derek@nats.io>
2021-09-29 18:59:21 -07:00
Derek Collison
1338a167e3 Merge pull request #2584 from nats-io/sealed-stream
Allow streams to be sealed through a stream update.
2021-09-29 16:02:58 -07:00
Derek Collison
5fc2cc5754 Allow streams to be sealed through a stream update.
Sealed streams can not accept new messages, allow you to delete or purge messages, or have messages expire due to age.
Sealed stream can not be unsealed through an update.

Signed-off-by: Derek Collison <derek@nats.io>
2021-09-29 15:25:38 -07:00
R.I.Pienaar
98ef6cb03c fixes the msg get audit event
We resused msg variable for both the request
and later the data loaded from the stream.

The data thus replaces the request and the audit
had the data as both request and response

Signed-off-by: R.I.Pienaar <rip@devco.net>
2021-09-29 17:36:38 +02:00
Matthias Hanel
377a46eedd Merge pull request #2580 from nats-io/hdr-ping
[fixed] missing support for header in some request handler
2021-09-28 17:41:15 -04:00
Matthias Hanel
9c01794f5f Merge pull request #2581 from nats-io/src-mirror-ln-3way
added unit test to test stream source/mirror cross different domains
2021-09-28 17:41:04 -04:00
Matthias Hanel
11bf8505cf added unit test to test stream source/mirror cross different domains
Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-09-28 16:20:37 -04:00
Matthias Hanel
3379b3b612 [fixed] missing support for header in some request handler
Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-09-28 14:28:03 -04:00
Derek Collison
de83307e8d Log when we adjust the peer set size
Signed-off-by: Derek Collison <derek@nats.io>
2021-09-28 11:02:53 -07:00
Derek Collison
f4177bacbc Bump version
Signed-off-by: Derek Collison <derek@nats.io>
2021-09-27 19:59:05 -07:00
Derek Collison
74e2034aed Only adjust downward if we have a total >= original estimate
Signed-off-by: Derek Collison <derek@nats.io>
2021-09-27 18:39:37 -07:00
Derek Collison
8223275c44 On cold start in mixed mode if the js servers were not > non-js we could stall.
Signed-off-by: Derek Collison <derek@nats.io>
2021-09-27 16:59:42 -07:00
Ivan Kozlovic
6400c8cabf Release v2.6.1
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-09-23 17:47:47 -06:00
Ivan Kozlovic
812ba157ba Merge pull request #2568 from nats-io/js-conn-cnt
[FIXED] Internal connections were counted toward account's max connections (client or leaf)
2021-09-23 17:45:00 -06:00
Derek Collison
15fb253c7c Revert back to old subject, don't suppress updates on non client/leaf
Signed-off-by: Derek Collison <derek@nats.io>
2021-09-23 16:07:35 -07:00
Derek Collison
3740a707f6 Do not count non client or leafnode connections for account limit reporting.
Signed-off-by: Derek Collison <derek@nats.io>
2021-09-23 15:43:07 -07:00
Derek Collison
77eb639b2c Merge pull request #2569 from nats-io/catchup
Improve handling when exceeding account resources.
2021-09-23 14:48:20 -07:00
Derek Collison
7340dde408 Improve handling when exceeding account resources and trying to catch up streams, etc.
Signed-off-by: Derek Collison <derek@nats.io>
2021-09-23 14:21:14 -07:00
Ivan Kozlovic
7b25755980 Adjust timing
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-09-23 09:56:42 -06:00
Matthias Hanel
6fe3939ca4 NO COMMIT, demonstrate JS conn count
Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-09-23 11:53:34 -04:00
Ivan Kozlovic
23e8dc9902 Fix corrupt wal test that was flapping
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-09-23 09:36:46 -06:00
Ivan Kozlovic
7d389169d5 Update version to beta until ready to release
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-09-23 09:08:54 -06:00
Ivan Kozlovic
d58b2a106f Merge pull request #2563 from nats-io/mixed_enablement_js
[FIXED] Storage limit of 0, which means disabled, was not always enforced
2021-09-22 17:52:05 -06:00
Ivan Kozlovic
93dc39dcda Fixed other MQTT test that was setting JWT mem but not disk limits
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-09-22 17:24:33 -06:00
Ivan Kozlovic
a3be36fcd4 Moving 2 new tests to jetstream test file
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-09-22 17:02:29 -06:00
Ivan Kozlovic
b0d487fe68 Fix MQTT test that was not setting MaxStore
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-09-22 16:51:34 -06:00
Derek Collison
f6f5d6d4b2 Merge pull request #2564 from nats-io/max-consumers
Direct consumers used for mirroring should not be affected by max consumers limits
2021-09-22 15:29:28 -07:00
Derek Collison
944b90d4a3 Fix for no storage limits
Signed-off-by: Derek Collison <derek@nats.io>
2021-09-22 15:28:43 -07:00
Derek Collison
ebb24006c2 Direct consumers used for mirroring should not be affected by max consumer limits
Signed-off-by: Derek Collison <derek@nats.io>
2021-09-22 15:01:51 -07:00
Derek Collison
075e8c9070 Make sure wp is > len(cache.buf)
Signed-off-by: Derek Collison <derek@nats.io>
2021-09-22 14:46:31 -07:00
Matthias Hanel
060beff99f NO COMMIT, unit test to show issue with mixed enablement of js storage
Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-09-22 17:20:14 -04:00
Derek Collison
eab45b404a Fix for deadlock with stream mirrors or sources where origin is interest or workqueue policy.
Signed-off-by: Derek Collison <derek@nats.io>
2021-09-22 10:59:02 -07:00