Commit Graph

2661 Commits

Author SHA1 Message Date
Derek Collison
bb7a8a5f79 Introduced default max ack pending for ack explicit.
Fixed a bug that would introduce performance degradation for durable consumers R>1.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-30 11:47:24 -07:00
Derek Collison
14a826fb60 Check for entries going negative. Shutdown in place on server exit
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-30 11:46:15 -07:00
Matthias Hanel
6ffe9adf97 [added] disconnect of all clients and disable account on remove
Error sent to the client: Account Authentication Expired

Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-03-30 02:24:02 -04:00
Matthias Hanel
c3479d339e [added] ability to remove account jwt using an operator signing key
Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-03-29 23:58:28 -04:00
Ivan Kozlovic
9c036778c0 [FIXED] Websocket: print correct random port instead of 0
When a random port is selected (likely in tests), the banner would
print the port as `0` instead of its real value.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-03-29 16:01:38 -06:00
Derek Collison
874e13f5b9 Merge pull request #2036 from nats-io/fix-race
Guard account client map
2021-03-29 09:25:04 -07:00
Derek Collison
389c3882be Update based on staticcheck update
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-29 07:48:39 -07:00
Derek Collison
5a48369b4b Make sure to not delete streams on bad updates.
If an update was asssigned but failed at the stream group server we would send back the result which would always delete the stream.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-29 07:35:30 -07:00
Derek Collison
327d913ae1 Under rare scenarios we could fail to load, but this should not be a panic.
We should recover on the lines below.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-29 07:34:28 -07:00
Derek Collison
c8d812d805 Release server lock when getting usage
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-27 17:38:57 -07:00
Matthias Hanel
03aee09847 [Added] error when mirror/source stream prefix overlaps with stream subs (#2041)
* [Added] error when mirror/source stream prefix overlaps with stream subs

Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-03-27 14:01:51 -04:00
Matthias Hanel
9f753a2475 [fixed] issue where verify_and_map: true in leaf node config was not used (#2038)
* [fixed] issue where verify_and_map: true in leaf node config was not used

This broke the setup in such a way that any connect relying on this would have failed.
This also fixes an issue where specifying no account did not result in using $G.

Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-03-26 19:24:01 -04:00
Ivan Kozlovic
b17f38e356 [FIXED] Websocket: do not generate empty frames + LN corruption
- It was possible that when the server was sending frames to a
webbrowser, it would send empty frames. While technically not wrong,
prevent that from happening.
- Not copying enqueued buffers could cause corruption with LN+WS.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-03-26 16:17:46 -06:00
Derek Collison
6c702b3b5d RC10
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-26 14:41:09 -07:00
Derek Collison
0f71c260fb Durable consumers with R>1 had performance challenges.
This code changes the way we handle raft based proposals for consumers.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-26 12:53:49 -07:00
Jaime Piña
6095e8f46d Guard account client map 2021-03-26 10:30:16 -07:00
Derek Collison
2d2938239f Bump to RC9
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-26 05:28:23 -07:00
Derek Collison
c564b18482 Protect against negative
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-26 05:28:00 -07:00
Derek Collison
82d2704594 Increase connection timeout to avoid test failures when running whole test suite.
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-26 04:58:30 -07:00
Derek Collison
8f671deb91 Calling out to the storage update should not hold lock.
We had lock inversion with consumers.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-26 04:40:30 -07:00
Derek Collison
2e0c4e8601 Merge pull request #2033 from nats-io/RC8
RC8
2021-03-25 19:25:31 -07:00
Derek Collison
5d6fe9e4b0 Check for subject overlaps after check for pre-existing
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-25 19:00:15 -07:00
Derek Collison
c05ff97d09 Fixes based on PR feedback
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-25 18:09:35 -07:00
Derek Collison
da7b7f9f85 Make sure to configure global account for reload
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-25 18:06:14 -07:00
Derek Collison
1ae3d41e26 Reload already calls configAll
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-25 17:24:03 -07:00
Derek Collison
5d5de5925f Introduce a previous leader state in the raft layer to allow quicker responses when leaderless.
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-25 17:08:29 -07:00
Derek Collison
282def10fd Fix data race
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-25 17:07:34 -07:00
Derek Collison
6cd6c380f1 Make standalone mode ignore leaf connections
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-25 16:13:23 -07:00
Derek Collison
e53caee5e8 Enforce server limits even when dynamic limits for accounts in play.
We were not properly enforcing server limits. This commit will allow a server to enforce limits but still remain functional even at the JetStream level.
Also fixed a bug for RAFT replay that could cause instability.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-25 16:06:27 -07:00
Derek Collison
a627db9fc8 Do not request streaminfo from streams that are completely offline.
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-24 10:26:09 -07:00
Derek Collison
06803dafbf Tweak seq tracking for flow control, also fixup code
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-24 09:46:54 -07:00
Derek Collison
2ed53035ed Reworked flow control for sources and mirrors.
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-24 07:07:33 -07:00
Derek Collison
6f8c0f9193 Fix broken test
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-22 20:31:28 -07:00
Derek Collison
a75e8f8c80 Fix for an issue with multiple restarts that showed stalled and sometimes lost streams.
The issue was when a state was removed from a server and restarted it would catch up properly.
However upon cluster restart the system could exhibit strange behaviors. This was due to on
catchup not properly creating a meta snapshot when one was received, leaving no meta state to recover.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-22 20:06:38 -07:00
Matthias Hanel
3619b186c6 [fixed] version parsing issue that got tripped by extra .
This broke due to the RC portion 2.2.1.RC1 without -

Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-03-22 20:48:10 -04:00
Derek Collison
022c5b4ab2 Fix for bad behavior with flow control and multiple sources streams.
Allow chaining of sources and mirrors with filtered consumers.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-22 11:13:51 -07:00
Derek Collison
7284756a8e Update to use Go client
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-21 09:31:17 -07:00
Derek Collison
0f548edcc6 Reduce sliding window for direct consumers and catchup stream windows.
Remove another possible wire blocking operation in raft.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-21 09:24:27 -07:00
Derek Collison
a4119e13c1 Fix for new data race detected
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-20 17:46:59 -07:00
Derek Collison
fcd4d0b75f Removed un-needed check in test
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-20 17:11:58 -07:00
Derek Collison
0bcda04a9d Send both last consumer and stream sequence for idle hb
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-20 16:57:13 -07:00
Derek Collison
2d46c112d6 Make sure to not interrupt flow control unless we miss.
Fix deadlock for mirrors.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-20 15:05:41 -07:00
Derek Collison
ced35e5b8c Reworked sources and mirrors on missed data.
Add last delivered sequence to consumer idle heartbeats.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-20 14:03:46 -07:00
Derek Collison
faa6dc85eb Fix for flapping test
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-20 11:16:40 -07:00
Derek Collison
14a896fee8 Wait longer
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-20 10:53:12 -07:00
Derek Collison
4c6fd179d6 Can not use sub comparisons for old messages from direct consumers.
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-20 10:30:09 -07:00
Derek Collison
1dde8aed5d Do not send idle heartbeats if not active
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-20 09:22:06 -07:00
Derek Collison
d9b78b8bc4 Update info status for JetStream when disabling and restarting
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-20 09:07:47 -07:00
Derek Collison
cfe2f448ad Fix for when gateways were dropped and we did not detect interest returning.
Fix for leaked subscription when retrying the source consumers.
Better suppression of old messages from old direct consumers.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-20 08:44:18 -07:00
Derek Collison
04a9d51035 Fix for data race
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-20 07:15:36 -07:00