Commit Graph

2224 Commits

Author SHA1 Message Date
Waldemar Quevedo
dbbf4fdf96 Add --server_name flag to set server name
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2021-01-26 12:16:31 -08:00
Ivan Kozlovic
0fe9209b52 Merge pull request #1840 from angiglesias/allow-mqtt_bearer_token
[ADDED] Allow bearer token as mqtt authentication method
2021-01-26 12:14:03 -07:00
Derek Collison
7efb9a6456 Bump Beta Version
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-26 05:23:35 -08:00
Derek Collison
bcd38bba96 Make sure stepdown logic does not block system
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-25 19:20:10 -08:00
Derek Collison
fc829950bd Bump Beta Version
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-25 18:23:48 -08:00
Derek Collison
e40c3e6f55 Templates not supported currently in clustered mode
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-25 17:13:31 -08:00
Derek Collison
d278996272 LDM trigger to move raft leaders
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-25 16:52:19 -08:00
Derek Collison
7eb6d07bfc On stepdown still process appendEntry
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-25 14:32:24 -08:00
Derek Collison
7d8c3eaa6e Don't pre-vote, causes flapping on split vote
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-25 13:49:20 -08:00
Derek Collison
162bc1a0c4 Bump beta version
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-25 11:54:48 -08:00
Derek Collison
c7c86c7929 Attempt to fix flapper
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-25 10:25:47 -08:00
Derek Collison
5148bbf898 Fixes based on PR feedback, cleanup
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-25 10:04:21 -08:00
Ángel
07c3214473 Added tests for MQTT bearer token authentication
Signed-off-by: Ángel <angelo.fly1@gmail.com>
2021-01-25 18:44:28 +01:00
Ángel
4fd58efa84 Allow use MQTT Connection password field as a JWT to authenticate clients
Signed-off-by: Ángel <angelo.fly1@gmail.com>
2021-01-25 18:11:20 +01:00
Derek Collison
7b1e84c086 Fixed raft bug that would cause entries to be missed on restart with leader HB trigger.
Also added in creation times to stream and consumer assignments to make them consistent.

Signed-off-by: Derek Collison <derek@nats.io>
2021-01-25 08:47:37 -08:00
Derek Collison
117607ef11 Fix for race and test for issue R.I. was seeing in nightly. Also fixed flappers.
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-24 21:21:02 -08:00
Derek Collison
a72ddedb55 Fix for issue with stream info and R=1 and fix for a flapper
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-24 19:48:33 -08:00
Derek Collison
9c858d197a Added ability to properly restore consumers from a snapshot.
This made us add forwarding proposals functionality in the raft layer.
More general cleanup and bug fixes as well.

Signed-off-by: Derek Collison <derek@nats.io>
2021-01-24 19:30:34 -08:00
Derek Collison
cad0db2aec Cleanup the consumer assignments when consumers become inactive.
This involved extending our raft implementation to forward proposals to the current leader.

Signed-off-by: Derek Collison <derek@nats.io>
2021-01-23 13:44:10 -08:00
Derek Collison
d1d2d5b24e Fix for consumer names list in clustered mode
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-23 10:09:44 -08:00
Derek Collison
cb2433c2fc Fix for cluster info with R=1
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-23 10:04:43 -08:00
Derek Collison
277483b386 Change over last to active and a duration
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-22 12:34:21 -08:00
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