Commit Graph

2202 Commits

Author SHA1 Message Date
Derek Collison
da698ca888 Merge branch 'master' into jsc_limits 2021-01-22 12:13:28 -07:00
Derek Collison
a43a69a403 Fix for interest only, broken test
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-22 11:04:06 -08:00
Derek Collison
227901a56b More cleanup and stabilization for consumers and failing when sending messages.
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-22 10:09:30 -08:00
Phil Pennock
393b4ca83d Bump version's beta (#1834) 2021-01-22 12:31:25 -05:00
Derek Collison
e203b1b568 Bumped beta version
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-21 19:22:36 -08:00
Derek Collison
6f2b50a374 Added support for clustered account info and limit enforcement
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-21 18:47:21 -08:00
Matthias Hanel
d35cd2996d [added] jwt/issuerkey/nametag/tags to monitoring and event endpoints (#1830)
Also added a trace on jwt authentication

Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-01-21 21:16:34 -05:00
Matthias Hanel
9081646109 [added] support for tags and filter ping monitoring requests by tags (#1832)
fixes #1588

Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-01-21 21:16:09 -05:00
Derek Collison
3db95f48e3 spelling
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-20 12:46:20 -08:00
Derek Collison
e7414a0b11 Fix data race
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-20 12:00:22 -08:00
Derek Collison
8dc1c42fe3 Bump version, remove spurious debug prints
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-20 11:58:31 -08:00
Derek Collison
9949904abc Fix data race
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-20 11:58:31 -08:00
Derek Collison
4c965323f2 Additional stabilizations for split votes, general fixes
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-20 11:58:31 -08:00
Derek Collison
7c0b6faf2c We were having issues with the account being changed for the internal system client.
This changes when we are sending internal messages through the shared internal sendq but to a different account.
We will now use an internal client that is only accessible to the send loop.

Signed-off-by: Derek Collison <derek@nats.io>
2021-01-20 11:58:31 -08:00
Derek Collison
55d750733b Fix based on feedback from Ivan
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-20 11:58:31 -08:00
Derek Collison
fed4c0cce0 Race detector cacthes this now with 1.15.7
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-20 11:58:31 -08:00
Derek Collison
ff54c9dc9c Reworked snapshot and restore.
Underestimated the effort to get stream restore working properly in cluster mode.
Some good bug fixes and stability improvments.

Signed-off-by: Derek Collison <derek@nats.io>
2021-01-20 11:58:31 -08:00
Derek Collison
2e9545d587 Make snapshot API cluster aware
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-20 11:58:31 -08:00
Derek Collison
a1730f1b31 Report on RAFT group information.
This adds in optional reporting to stream and consumer info when running in clsutered mode.

Signed-off-by: Derek Collison <derek@nats.io>
2021-01-20 11:58:31 -08:00
Ivan Kozlovic
f5df209022 Fixed SIGSEGV when sending update for unknown stream
Will now return an error that the stream is unknown.

Resolves #1827

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-01-20 12:42:14 -07:00
Ivan Kozlovic
7d1a4778b8 Merge pull request #1826 from nats-io/fix_consumer_loop_delivery_exit
Fix stop of consumer's delivery loop
2021-01-20 10:34:57 -07:00
Ivan Kozlovic
a1f0117474 Fixed consumer sending to nil channel on shutdown/leader change.
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-01-20 10:05:15 -07:00
Ivan Kozlovic
c4a284b58f Fix stop of consumer's delivery loop
I noticed that some consumer go routines were left running at the end
of the test suite.
It turns out that there was a race the way the consumer's qch was closed.
Since it was closed and then set to nil, it is possible that the go
routines that are started and then try to capture o.qch would actually
get qch==nil, wich then when doing a select on that nil channel would
block forever.

So we know pass the qch to the 2 go routines loopAndGatherMsgs() and
loopAndDeliverMsgs() so that when we close the channel there is
no risk of that race happening.

I do believe that there is still something that should be looked at:
it seems that a consumer's delivery loop can now be started/stopped
many times based on leadership acquired/lost. If that is the case,
I think that the consumer should wait for previous go routine to
complete before trying to start new ones.

Also moved 3 JetStream tests to the test/norace_test.go file because
they would consumer several GB of memory when running with the -race flag.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-01-19 17:39:32 -07:00
Ivan Kozlovic
42dcdd2eb2 Simplify sendSubsToRoute()
Since we were creating subs on the fly, sub.im would always be nil.
We were passing a client because it was needed in sendRouteSubOrUnSubProtos().

This PR simply fills the buffer with each account's subscriptions.
There is also no need to have subs sent from different go routine
based on some threshold. Routes are no longer subject to max pending.

Some code has been made into a function so that they can be shared
by sendSubsToRoute() and sendRouteSubOrUnSubProtos(). The function
is simply adding to given buffer the RS+/- protocol.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-01-19 14:01:43 -07:00
Derek Collison
e4bf3767f2 Only send if we deleted properly
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-17 13:48:40 -08:00
Derek Collison
78747b2414 Stability improvements around startup and restore.
We were incorrectly starting clustering before enabling accounts and restoring state.

Signed-off-by: Derek Collison <derek@nats.io>
2021-01-17 13:44:49 -08:00
Derek Collison
d653627e7a Stabilty improvements for split votes.
Was incorrectly resetting term and exiting on failed vote. Also was not properly stepping down when we were a candidate and saw an entry from a leader.

Signed-off-by: Derek Collison <derek@nats.io>
2021-01-17 13:34:56 -08:00
Derek Collison
5479a8e867 Fix for segfault
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-17 13:19:11 -08:00
Derek Collison
8d568d41e4 Copy off before starting Go routine
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-17 13:05:25 -08:00
Derek Collison
fe9e45bbd2 Updates based on PR comments
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-17 12:08:35 -08:00
Derek Collison
a18a6803c1 Added support for stream and consumer lists.
This utilizes a scatter and gather approach.

Signed-off-by: Derek Collison <derek@nats.io>
2021-01-16 12:42:45 -08:00
Derek Collison
cb69df7118 Add proper support for stream update
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-16 06:29:37 -08:00
Derek Collison
b606dceb59 Stabilize restart/catchup for raft.
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-16 05:47:48 -08:00
Derek Collison
367d000314 Merge pull request #1815 from nats-io/jscfix
Routes send subscriptions by utilizing random clients from an account.
2021-01-15 18:26:38 -07:00
Ivan Kozlovic
de1bf362b1 Merge pull request #1816 from nats-io/fix_gw_hash
Fixed gateway reply mapping following changes in JetStream clustering
2021-01-15 18:22:18 -07:00
Ivan Kozlovic
1874964498 Merge pull request #1812 from nats-io/leafnode_fixes
Fixed some leafnode issues introduced from JS cluster work
2021-01-15 18:22:02 -07:00
Derek Collison
754e31a3bc Routes send subscriptions by utilizing random clients from an account.
There was a bug where the client chosen under the $SYS account could have a different account.

Signed-off-by: Derek Collison <derek@nats.io>
2021-01-15 17:02:38 -08:00
Ivan Kozlovic
ef38abe75b Fixed gateway reply mapping following changes in JetStream clustering
Those changes are required to maintain backward compatibility.
Since the replies are "_G_.<gateway name hash>.<server ID hash>"
and the hash were 6 characters long, changing to 8 the hash function
would break things.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-01-15 17:32:04 -07:00
Ivan Kozlovic
c9bba7d1e3 Change back "server_name" to "name" for backward compatibility
The LeafNode connect protocol's Name field had json tag "name" but
was changed to "server_name" in the JetStream cluster branch.
Changing it back to "name" to not have to deal with different
places where to get the name from.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-01-15 14:00:21 -07:00
Derek Collison
7286033a6f Merge pull request #1813 from nats-io/fixes
Fixes for data races
2021-01-15 12:18:00 -07:00
Ivan Kozlovic
0d78bce9cf Fixed some leafnode issues introduced from JS cluster work
Also fixed a flapper.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-01-15 12:00:34 -07:00
Ryota
91a1d9a556 Update error message with correct config value 2021-01-15 13:18:31 +00:00
Ivan Kozlovic
6f8285b1f0 Merge pull request #1806 from nats-io/latency-sharing
Fixing latency sharing which was overwritten
2021-01-14 16:57:15 -07:00
Matthias Hanel
f1af382929 Fixing latency sharing which was overwritten
Also adjusting unit test to not check for renamed values

Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-01-14 18:47:44 -05:00
Ivan Kozlovic
343968067c Merge pull request #1805 from nats-io/scoped-signing-keys
[added] enforcement and usage of scoped signing keys
2021-01-14 15:24:28 -07:00
Matthias Hanel
2cb5f1b391 Fix flapping unit test and incorporate more review comments
Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-01-14 16:59:57 -05:00
Derek Collison
4b84decc7f Fix for race
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-14 12:59:12 -08:00
Derek Collison
36f0dd5881 Fix data race
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-14 12:25:42 -08:00
Matthias Hanel
c14076b13f Incorporating review comments
Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-01-14 15:15:20 -05:00
Matthias Hanel
2edd883a6e [added] enforcement and usage of scoped signing keys
Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-01-14 14:52:54 -05:00