Commit Graph

141 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
b00b723168 Mirrors were not properly retrying after failures to create their internal consumer.
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-18 06:13:26 -07:00
Derek Collison
601dbf48c1 Protect against the stream nil'ing out the outq for the consumer
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-17 18:51:18 -07:00
Derek Collison
74cc2b581a When a stream is a mirror or has sources we need to check the upstream streams for filter subject correctness.
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-17 06:39:21 -07:00
Derek Collison
7ade99d102 Don't set to nil on stop to avoid any panics accessing that map.
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-15 09:13:29 -07:00
Derek Collison
ee92cc9a5b Properly print when a stream is doing out of band catchup. Print node banner consistently
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-14 07:29:36 -07:00
Derek Collison
299f44cddf This changes our behaviors for streams and peer removals in several ways.
First we no longer try to auto-remap stream assignments on peer removals from the system.
We also now can always respond to stream info requests if at least a member is running.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-11 06:52:28 -05:00
Ivan Kozlovic
84fbcdcd34 Remove internal retries for mirrors and sources
We let the go routine do it.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-03-10 15:47:19 -07:00
Ivan Kozlovic
27f51d4028 Fix ephemeral consumer delete in single cluster
Also remove retry of sources/mirror in the setSourceConsumer() itself
when not getting a response.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-03-10 15:16:31 -07:00
Derek Collison
263f4452c3 Delete no longer needed
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-10 07:15:58 -05:00
Derek Collison
f95b6481d2 Make source and mirror consumers direct, meaning they are not mapped by the metaleader.
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-10 07:12:48 -05:00
Ivan Kozlovic
52c4ab60f6 Merge pull request #1982 from nats-io/fix_idle_hbs_and_js_remote_unsubs
Fixed consumer idle hearbeats and JS route/GWs unsubscribes
2021-03-09 13:23:25 -07:00
Ivan Kozlovic
ccec4a6ab1 Fixed consumer idle hearbeats and JS route/GWs unsubscribes
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-03-09 12:08:47 -07:00
Waldemar Quevedo
86a64fbc46 Updates to JS consumer errors
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2021-03-09 09:46:28 -08:00
Derek Collison
ea9abc5ef8 Wait longer for response
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-09 05:41:00 -06:00
Derek Collison
e5e8205fac Need to make sure order of clseq as stamped also make it to the propose chan.
However we do not want to hold the actual stream lock.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-09 00:34:33 -06:00
Ivan Kozlovic
57af977548 Stabilized stream sources under restart
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-03-08 16:41:02 -07:00
Derek Collison
467614ea87 Make sure to check for old messages during processsing.
Also changed the way we detect old messages.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-08 15:42:03 -06:00
Derek Collison
673543c180 Modified flow control for clustered mode.
Set channels into and out of RAFT layers to block.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-08 12:58:57 -06:00
Derek Collison
5fe9ba5e94 Switched to fast state
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-06 09:00:15 -08:00
Derek Collison
0b3c686430 Fixes for data races and some locking.
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-05 17:19:51 -08:00
Derek Collison
ff98984358 Reworked internal consumers used for sources and mirrors.
Now use ephemerals and heartbeats and flowcontrol.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-05 14:32:57 -08:00
Derek Collison
dd8acb1a99 Fixed a bug where we were not determing clustered state so were straight processing msgs from routes.
Cleaned up lseq and clseq code.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-05 12:00:19 -08:00
Derek Collison
75b0455e0b Enable opt-in flow control for push based consumers.
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-05 08:48:12 -08:00
Derek Collison
4bfd6485f6 Can't remove based on interest directly
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-04 19:11:24 -08:00
Derek Collison
207ebd3b3d Changed stream sendq to linked list outq.
Made consumer share streams outq.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-04 17:19:50 -08:00
Derek Collison
e70e46ea4a Updates based on PR feedback
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-04 16:16:28 -08:00
Derek Collison
bfb8e3432e Move RAFT comms off internal sendq.
Move route and gateway msgs our of fast path for inbound stream msgs.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-04 14:45:34 -08:00
Derek Collison
d7201a110b Better handling on out of disk.
Suppress some stream and consumer bad results since they delete the asset.
Allow rehup to re-enable JetStream.
Various bug fixes and improvements.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-03 20:12:10 -08:00
Derek Collison
4f7fbefc7c In clustered JetStream we need to move API calls out of routes/gateways/leafnodes path.
This moves from explicit imports and subscriptions to one wildcard subscription and a single wildcard export.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-02 17:54:41 -08:00
Derek Collison
49cd38c064 Enable cross account behaviors for mirrors and sources.
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-02 06:36:57 -08:00
Derek Collison
2d70429f83 More conservative in replay
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-01 14:22:27 -08:00
Derek Collison
8cfc56f8b0 Enable support for changing config on stream restore.
Signed-off-by: Derek Collison <derek@nats.io>
2021-02-28 10:01:01 -08:00
Derek Collison
b9e1a921ff Use internal wildcard inbox for stream and consumer info requests.
More gateway friendly but suffers from no echo, so added new client based internal send.

Signed-off-by: Derek Collison <derek@nats.io>
2021-02-28 10:01:01 -08:00
Derek Collison
9fc7561c40 Support updating sources via stream update.
Tweaked internal consumers and flow logic for sources and mirrors.

Signed-off-by: Derek Collison <derek@nats.io>
2021-02-28 05:17:17 -08:00
Derek Collison
7c670e4eae Allow sources and mirrors to not be pre-defined.
Will keep trying to establish contact.

Fixed bug where double source headers for sourced messages were causing issues.

Signed-off-by: Derek Collison <derek@nats.io>
2021-02-26 07:32:29 -08:00
Derek Collison
752f67acee Explicit on async and sync settings
Signed-off-by: Derek Collison <derek@nats.io>
2021-02-25 17:08:14 -08:00
Derek Collison
36a2cbeff7 Cross account pull consumers would not work correctly due to reply subject rewrite.
Signed-off-by: Derek Collison <derek@nats.io>
2021-02-24 13:33:24 -08:00
Derek Collison
20d250c7cf Move storage type to own variable for unlocked access, can't change
Signed-off-by: Derek Collison <derek@nats.io>
2021-02-23 17:20:12 -08:00
Derek Collison
09e3d26fa3 Add in support for stream mirrors and sources.
Add in proper support for stream updates in clustered mode.
Don't send API updates without subjects, caused GW parser errors.
Stream internal loops use their own clients now.

Signed-off-by: Derek Collison <derek@nats.io>
2021-02-23 10:57:27 -08:00
Ivan Kozlovic
61bd1b8d86 MQTT clustering
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-02-19 08:50:00 -07:00