Commit Graph

8305 Commits

Author SHA1 Message Date
Joe Henke
1e5b068585 Fix nats-general links 2023-09-26 07:37:57 -04:00
Derek Collison
c583f7fdc7 Bump to 2.10.2-RC.7
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-25 21:05:56 -07:00
Derek Collison
ee4d6ee40e [FIXED] Account resolver lock inversion (#4588)
There was a lock inversion but low risk since it happened during server
initialization. Still fixed it and added the ordering in
locksordering.txt file.

Also fixed multiple lock inversions that were caused by tests.

Signed-off-by: Ivan Kozlovic <ijkozlovic@gmail.com>
2023-09-25 21:05:11 -07:00
Derek Collison
3056af06d2 [FIXED] JetStream: stream assignment data race (#4589)
Two go routines could possibly execute the stream assignment at the same
time. A WaitGroup was used to prevent that, but an issue caused the data
race and possible concurrent execution.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2023-09-25 20:59:24 -07:00
Ivan Kozlovic
ca2a961fa7 [FIXED] JetStream: stream assignment data race
Two go routines could possibly execute the stream assignment at
the same time. A WaitGroup was used to prevent that, but an issue
caused the data race and possible concurrent execution.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2023-09-25 16:11:09 -06:00
Ivan Kozlovic
a84ce61a93 [FIXED] Account resolver lock inversion
There was a lock inversion but low risk since it happened during
server initialization. Still fixed it and added the ordering
in locksordering.txt file.

Also fixed multiple lock inversions that were caused by tests.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2023-09-25 15:09:11 -06:00
Derek Collison
83cc80ab74 Bump to 2.10.2-RC.6
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-25 13:33:03 -07:00
Derek Collison
73f8f87b86 [IMPROVED] The func subjectIsSubsetMatch() is heavy so do without the account lock. (#4586)
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-25 13:32:38 -07:00
Neil
62faa1882d Add prof_block_rate option for enabling/configuring the block profile (#4587)
The new `prof_block_rate` configuration option allows the block profiler
to be enabled on demand after it was previously disabled in #4402. The
option is also reloadable so that it can be changed after startup.

Signed-off-by: Neil Twigg <neil@nats.io>
2023-09-25 21:28:36 +01:00
Derek Collison
fb4e97e2ec If we know bigger go ahead an allocate.
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-25 13:12:13 -07:00
Neil Twigg
11feadfe7b Add prof_block_rate option for enabling/configuring the block profile
Signed-off-by: Neil Twigg <neil@nats.io>
2023-09-25 21:04:25 +01:00
Derek Collison
382da48180 The func subjectIsSubsetMatch() is heavy so do without the account lock.
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-25 13:01:46 -07:00
Derek Collison
54d4640e8b Bump to 2.10.2-RC.5
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-25 12:32:51 -07:00
Derek Collison
2e12b875d3 [IMPROVED] Move some contended locks to atomic.Bools (#4585)
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-25 12:31:33 -07:00
Derek Collison
a0029181ae Fix datarace
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-25 12:04:42 -07:00
Derek Collison
b70f874640 Moved to atomics to detect if we have mapped subjects for an account since check for each inbound message.
If an account has many connections on a server under heavy load this could be contended.

Signed-off-by: Derek Collison <derek@nats.io>
2023-09-25 11:43:34 -07:00
Derek Collison
7ce47fd182 Move server running state to atomic to avoid contention at NRG layer.
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-25 11:18:15 -07:00
Derek Collison
e594da52e4 Bump to 2.10.2-RC.4
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-25 09:21:12 -07:00
Derek Collison
3ecb741d4d [IMPROVED] Make sure to issue warning on reset for bad state (#4583)
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-25 09:19:18 -07:00
Derek Collison
e46f49f5d5 Make sure to issue warning on reset for bad state
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-25 09:04:54 -07:00
Neil
33d8de744d Set S2 writer concurrency to 1 (#4570)
By default the S2 library defaults to a concurrency level of
`GOMAXPROCS`, which forces the library to run extra goroutines to manage
asynchronous flushes.

As we only ever have one goroutine (the client writer) using a given S2
writer, reducing the concurrency down to 1 helps a bit with overheads,
slightly reduces allocations and slightly improves throughput.

Signed-off-by: Neil Twigg <neil@nats.io>
2023-09-25 16:28:13 +01:00
Neil Twigg
d4e8a44499 Set S2 writer concurrency to 1
Signed-off-by: Neil Twigg <neil@nats.io>
2023-09-25 09:54:54 +01:00
Derek Collison
f3411f623d Bump to 2.10.2-RC.3
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-24 16:03:49 -07:00
Derek Collison
30af2a46e8 In lameduck mode shutdown jetstream at start, do not leave running (#4579)
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-24 16:02:50 -07:00
Derek Collison
121adb4719 Bump start interval for cleanup check
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-24 15:44:15 -07:00
Derek Collison
f95ef63ae1 In lameduck mode shutdown jetstream at start, do not leave running during connection drain.
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-24 14:42:59 -07:00
Derek Collison
fe2c116a6b [FIXED] Make sure to not forward a message across a route for routed dq subs (#4578)
Mimic same behavior for normal subs.

Note that when a queue subscription is behind both a spoke leafnode
connection and a service import the message will be delivered over the
leafnode since service imports are binary signals that are just on. Need
a more thorough investigation for a proper fix. For now its best to not
have the service import on the spoke leafnode such that the raw queue
sub's information if relayed across the leafnode.

Signed-off-by: Derek Collison <derek@nats.io>

Resolves #4367
2023-09-24 13:54:39 -07:00
Derek Collison
13dcf319b4 Make sure to not forward a message across a route for dq sub when we are a spoke leaf node.
Mimi same behavior for normal subs.

Signed-off-by: Derek Collison <derek@nats.io>
2023-09-24 13:15:39 -07:00
Waldemar Quevedo
637d8f2921 Skip enabling direct gets if no commits (#4576) 2023-09-22 17:25:35 -07:00
Waldemar Quevedo
89d33d960b Skip enabling direct gets if no commits
Signed-off-by: Waldemar Quevedo <wally@nats.io>
2023-09-22 17:08:46 -07:00
Derek Collison
bbe172df8d Bump to 2.10.2-RC.2
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-22 14:34:13 -07:00
Derek Collison
6fdcd1e78c [FIXED] Protect against going upside down on mb.msgs. (#4575)
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-22 14:30:51 -07:00
Derek Collison
2716248b5e Protect against going upside down on mb.msgs.
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-22 14:17:45 -07:00
Derek Collison
ece431fc74 Bump to 2.10.2-RC.1
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-22 10:26:50 -07:00
Derek Collison
4bce936cec [IMPROVED] Make install snapshot errors rate limited for when catching up (#4574)
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-22 10:26:22 -07:00
Derek Collison
4824085171 Hold lock here as well
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-22 10:25:58 -07:00
Derek Collison
65e0fbfa51 Make install snapshot errors rate limited for when catching up
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-22 10:23:02 -07:00
Waldemar Quevedo
4cb7acb85e Bump v2.10.2 (#4569) 2023-09-21 19:01:05 -07:00
Derek Collison
24fe082467 [FIXED] We will panic since we unlock the mb in removeMsgBlock (#4571)
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-21 18:57:10 -07:00
Derek Collison
21e81a2961 We will panic since we unlock the mb in removeMsgBlock
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-21 18:34:38 -07:00
Byron Ruth
b36644b229 Bump v2.10.2
Signed-off-by: Byron Ruth <byron@nats.io>
2023-09-20 21:06:42 -04:00
Waldemar Quevedo
d3ef745f25 Release v2.10.1 (#4568) 2023-09-20 10:20:51 -07:00
Byron Ruth
4a1d399a21 Release v2.10.1
Signed-off-by: Byron Ruth <byron@nats.io>
2023-09-20 12:54:02 -04:00
Neil
496ca98c1a Fix consumer limits (#4567)
If Stream has consumer limits set, creating consumer with defaults will
fail in most cases.

Test didn't catch this, as by default, old JS client sets ack policy to
`none`. If the policy is different, it will fail to create consumer with
defaults. We agreed that default Ack Policy should be `explicit`

 Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
2023-09-20 17:07:11 +01:00
Tomasz Pietrek
ac2669a022 Fix consumer limits
Test didn't catch this error, as by default, old JS client
sets ack policy to none. If policy is different, it will fail
to create consumer with defaults.

Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
2023-09-20 17:37:05 +02:00
Neil
0623e4b4ea Remove subject_transform_dest (#4557)
Removes the single subject transform destination field any subject
transformation in StreamSources must now be done using the
SubjectTransforms array instead.
2023-09-20 15:57:56 +01:00
Jean-Noël Moyne
9fc2603263 Removes the single subject transform dest field from StreamSource
Co-authored-by: Jean-Noël Moyne <jnmoyne@gmail.com>
Co-authored-by: Neil Twigg <neil@nats.io>

Signed-off-by: Neil Twigg <neil@nats.io>
2023-09-20 15:28:45 +01:00
Neil
81c0a14193 Use new consumer create subject when single subject filter specified in SubjectFilters (#4564)
This fixes an issue where specifying a single subject filter, i.e. in
`SubjectFilters` or `SubjectTransforms`, instead of using
`SubjectFilter` would result in the old consumer create subject being
incorrectly used.

Signed-off-by: Neil Twigg <neil@nats.io>
2023-09-20 13:02:53 +01:00
Jean-Noël Moyne
40ce0a9d7e Use filter_subject when calling extended consumer create API
The server consumer creation code is picky and does indeed not accept a request send to the ExT subject if that request specifies the subject filter in the array (even if there is only one entry in the array).

Signed-off-by: Jean-Noël Moyne <jnmoyne@gmail.com>
Signed-off-by: Neil Twigg <neil@nats.io>

Co-authored-by: Jean-Noël Moyne <jnmoyne@gmail.com>
Co-authored-by: Neil Twigg <neil@nats.io>
2023-09-20 10:51:19 +01:00
Neil Twigg
ad63d702c4 Use new consumer create subject when single subject filter specified in SubjectFilters
Signed-off-by: Neil Twigg <neil@nats.io>
2023-09-20 10:51:19 +01:00