Commit Graph

5305 Commits

Author SHA1 Message Date
Ivan Kozlovic
48fd559bfc Reworked RAFT's leader change channel
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-01-13 13:12:11 -07:00
Ivan Kozlovic
fc7a4047a5 Renamed variables, removing the "c" that indicated it was a channel 2022-01-13 13:11:05 -07:00
Ivan Kozlovic
62a07adeb9 Replaced catchup and stream restore channels
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-01-13 13:09:49 -07:00
Ivan Kozlovic
645a9a14b7 Replaced RAFT's stepdown channel
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-01-13 13:09:01 -07:00
Ivan Kozlovic
2ad95f7e52 Replaced RAFT's vote request and response channels
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-01-13 13:08:05 -07:00
Ivan Kozlovic
d74dba2df9 Replaced RAFT's append entry response channel
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-01-13 13:06:48 -07:00
Ivan Kozlovic
b5979294db Replaced RAFT's append entry channel
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-01-13 13:06:29 -07:00
Ivan Kozlovic
ceb06d6a13 Replaced RAFT's apply channel
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-01-13 13:06:10 -07:00
Ivan Kozlovic
05c033c46c Replaced stream's inbound list
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-01-13 13:05:51 -07:00
Ivan Kozlovic
23ebf9d2f8 Adapted jsOutQ
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-01-13 13:05:27 -07:00
Ivan Kozlovic
2ca025b33d Adapted system sendq
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-01-13 13:05:07 -07:00
Ivan Kozlovic
b44e9e01b6 Replaced MQTT's send queue
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-01-13 13:03:53 -07:00
Ivan Kozlovic
92e8997506 Replaced system event queue
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-01-13 13:03:33 -07:00
Ivan Kozlovic
c377a997e4 Replaced ackMsgQueue
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-01-13 13:03:26 -07:00
Ivan Kozlovic
a890c4692d Added intra-process queue to exchange objects instead of channels
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-01-13 13:03:20 -07:00
Derek Collison
de5372efcc Merge pull request #2776 from nats-io/pull-consumer
Pull Consumer Updates
2022-01-13 10:26:40 -08:00
Derek Collison
7dc99c3840 Merge from main
Signed-off-by: Derek Collison <derek@nats.io>
2022-01-13 10:01:33 -08:00
Ivan Kozlovic
c9c603b7a0 Merge pull request #2573 from julius-welink/implement-rate-limiting
[ADDED] TLS connection rate limiter
2022-01-13 10:35:19 -07:00
Derek Collison
6619e7f13d Merge branch 'main' into pull-consumer 2022-01-13 09:14:33 -08:00
Derek Collison
165895906b Merge pull request #2781 from nats-io/rebuild-deadlock
When rebuilding the complete filestore state we need to do this in a go routine.
2022-01-13 08:05:56 -08:00
Waldemar Quevedo
0885ba247f Merge pull request #2782 from nats-io/js-and-monitoring
Start monitoring before JetStream during startup.
2022-01-13 07:13:39 -08:00
Waldemar Quevedo
ce4e4b5d47 Start monitoring before JetStream
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2022-01-12 21:38:22 -08:00
Matthias Hanel
3fa7adbc43 Merge pull request #2779 from nats-io/max-bytes
[Adding] support for JS MaxBytesRequired
2022-01-12 23:31:42 -05:00
Derek Collison
420a2ef514 When rebuilding the complete state need to do this in a go routine.
We did this properly above but forgot this one.

Signed-off-by: Derek Collison <derek@nats.io>
2022-01-12 20:19:45 -08:00
Derek Collison
103f710479 Fixed consumer info num pending bug.
Under load we could have a message committed to the underlying store when a consumer was being created and then it increase num pending again when the stream signals the consumers.
This fix just remembers the last seq of the state when we calculate sgap and test before adding in the stream code.

Signed-off-by: Derek Collison <derek@nats.io>
2022-01-12 20:03:26 -08:00
Ivan Kozlovic
d63bc726c9 Merge pull request #2780 from nats-io/raft_updates
[IMPROVED] JetStream clustering with lots of streams/consumers
2022-01-12 21:02:49 -07:00
Matthias Hanel
78bbcd791f [Adding] support for JS MaxBytesRequired
Signed-off-by: Matthias Hanel <mh@synadia.com>
2022-01-12 22:57:34 -05:00
Ivan Kozlovic
a7554bd5dd Merge pull request #2777 from hooksie1/2754
[ADDED] Ability to express the max_file_store and max_memory_store as a string (100M, etc..)
2022-01-12 20:41:38 -07:00
Ivan Kozlovic
ffe50d8573 [IMPROVED] JetStream clustering with lots of streams/consumers
Some operations could cause the route to block due to lock being
held during store operations. On macOS, having lots of streams/consumers
and restarting the cluster would cause lots of concurrent IO that
would cause lock to be held for too long, causing head-of-line
blocking in processing of messages from a route.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-01-12 20:37:00 -07:00
Derek Collison
43eff407b8 Add in explicit subscription for import responses when bound to a leafnode.
When we want to track service import response interest across a leafnode we need to send sub and unsub for all response _R_ subjects versus using a wildcard.

Signed-off-by: Derek Collison <derek@nats.io>
2022-01-12 18:24:03 -08:00
John Hooks
0b77d51905 Remove switch
Removes switch statement and uses map for finding correct multiple

Also uses ParseInt instead of Atoi for getting string integer.
2022-01-12 21:07:07 -05:00
John Hooks
4aa6c62bbc Fix non used error 2022-01-12 18:03:24 -05:00
John Hooks
d956d6d398 Review
Rename function
More easily read math
merged functions together
Changed from predefining error
Fix empty string issue
use same function for max mem store
2022-01-12 17:55:57 -05:00
Derek Collison
32c3c9ecfb Track interest properly across accounts for pull consumers
Signed-off-by: Derek Collison <derek@nats.io>
2022-01-12 12:16:53 -08:00
John Hooks
12f8179fd8 Add parsing of string for sizes
Checks the suffix of the string to create the size of the int64
2022-01-11 22:13:20 -05:00
John Hooks
d10c306585 Check if value is string or int64 2022-01-11 21:06:26 -05:00
Julius Žaromskis
a47e5e045c [ADDED] TLS connection rate limiter 2022-01-11 16:57:19 +02:00
Derek Collison
279f31ecb5 Add in ability to have ephemeral pull based consumers
Signed-off-by: Derek Collison <derek@nats.io>
2022-01-10 20:42:39 -08:00
Derek Collison
e12c8cda92 Add in ability to limit aspects of a pull request, specifically batch size and expiration.
Signed-off-by: Derek Collison <derek@nats.io>
2022-01-10 17:29:04 -08:00
Derek Collison
5592d923c4 Updated pull consumers.
Cleaned up code, made more consistent, utilize loopAndGather.
Allow pull consumers to have AckAll as well as AckExplicit.

Signed-off-by: Derek Collison <derek@nats.io>
2022-01-10 16:59:01 -08:00
Derek Collison
42818f06c1 Update client
Signed-off-by: Derek Collison <derek@nats.io>
2022-01-10 16:58:52 -08:00
Derek Collison
08ff14a24e Merge pull request #2771 from nats-io/overflow
Implement overflow placement for JetStream streams.
2022-01-07 11:03:15 -08:00
Derek Collison
d02ad88297 Only report peers that we have seen a stats/usage update for
Signed-off-by: Derek Collison <derek@nats.io>
2022-01-07 10:42:06 -08:00
Derek Collison
16f5c95785 Update atomics placements based on feedback
Signed-off-by: Derek Collison <derek@nats.io>
2022-01-07 09:50:19 -08:00
Derek Collison
de5022ad7e Make cluster placement log more detailed
Signed-off-by: Derek Collison <derek@nats.io>
2022-01-07 07:44:30 -08:00
Derek Collison
52da55c8c6 Implement overflow placement for JetStream streams.
This allows stream placement to overflow to adjacent clusters.
We also do more balanced placement based on resources (store or mem). We can continue to expand this as well.
We also introduce an account requirement that stream configs contain a MaxBytes value.

We now track account limits and server limits more distinctly, and do not reserver server resources based on account limits themselves.

Signed-off-by: Derek Collison <derek@nats.io>
2022-01-06 19:33:08 -08:00
Ivan Kozlovic
ccc9e1621d Merge pull request #2769 from nats-io/ws_x_forwarded_for_changes
Add X-Forwarded-For IP to the client's remote address
2022-01-04 10:14:49 -07:00
Ivan Kozlovic
8d6eacc245 Add X-Forwarded-For IP to the client's remote address
Instead of replacing connection's host with value specified by
this header, we will simply add the address to the logging only.
So instead of having something like:
```
192.168.1.1:5678 - wid:10 - Client connection created
```
we could have:
```
1.2.3.4/192.168.1.1:5678 - wid:10 - Client connection created
```
As seen above, this PR simply prefixes the connection's remote address
with the header's value (if a valid IP).

Related to #2734
Resolves #2767

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-01-03 11:56:12 -07:00
Derek Collison
fbcf1aba30 Merge pull request #2766 from kfabryczny/fix_doc_link
FIX: Fix broken link to monitoring documentation
2021-12-30 08:38:25 -08:00
Klaudiusz Fabryczny
b2b33110e2 FIX: Fix broken link to monitoring documentation 2021-12-30 14:04:12 +01:00