Commit Graph

462 Commits

Author SHA1 Message Date
Derek Collison
75908f80a4 API cleanup
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:07:02 -07:00
Derek Collison
da7838368d Tracking usage and limits
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:07:02 -07:00
Derek Collison
b7b98df4ee Server limits and account reservations
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:07:02 -07:00
Derek Collison
8ba8abfab9 Observable replay policy to control rate of replay
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:07:02 -07:00
Derek Collison
7e00a975b1 Add purge and interest retention tests
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:07:02 -07:00
Derek Collison
171a59754d Implement delivery count, nak checks, no restart on nak
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:07:02 -07:00
Derek Collison
b8c958ed07 Nak as restart semantics on push based observable
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:07:02 -07:00
Derek Collison
98bd8234b6 Rework of delivery sequence vs store sequence and ack reply subjects
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:07:02 -07:00
Derek Collison
68c9394a3f Make sure to update pending timestamp on redelivery
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:07:02 -07:00
Derek Collison
ac40ecaef9 Durable reassignment and takeover
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:07:02 -07:00
Derek Collison
77c75baa6e Flush first progress ack
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:07:02 -07:00
Derek Collison
0fb7ee32bc Auto-expiration of ephemeral push based observables
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:07:02 -07:00
Derek Collison
d02b2a3d9c NoAck option for MsgSets
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:07:02 -07:00
Derek Collison
d327a91143 Working ACK indicator
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:07:02 -07:00
Derek Collison
4eee93dea0 NAK for workers
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:07:02 -07:00
Derek Collison
0a92d8e87d AckWait and redelivery
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:07:02 -07:00
Derek Collison
ccbd3d6032 cleanup
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:07:02 -07:00
Derek Collison
16e6952cd6 Move load balance test to norace
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:07:02 -07:00
Derek Collison
4698292d4f Added push based observable no ack benchmark
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:07:02 -07:00
Derek Collison
5d5d5cbd60 Add AckNext and batch size for worker pull mode
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:07:02 -07:00
Derek Collison
a9d1989047 test updates
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:07:02 -07:00
Derek Collison
ea85d0130f Reworked load balance test
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:07:02 -07:00
Derek Collison
cd3c1c7a3f Basic partitioning
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:07:02 -07:00
Derek Collison
98b78d06c4 First pass pull mode, e.g. worker
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:07:02 -07:00
Derek Collison
dd116fcfd4 JetStream first pass basics.
This is the first checkin for JetStream. Has some rudimentary basics working.

TODO
1. Push vs pull mode for observables. (work queues)
2. Disk/File store, memory only for now.
3. clustering code - design shaping up well.
4. Finalize account import semantics.
5. Lots of other little things.

Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:06:29 -07:00
Waldemar Quevedo
9a2d095885 Add support to match domainComponent (DC) in RDNSequence with TLS Auth
Currently when using TLS based authentication, any domain components
that could be present in the cert will be omitted since Go's
ToRDNSequence is not including them:

202c43b2ad/src/crypto/x509/pkix/pkix.go (L226-L245)

This commit adds support to include the domain components in case
present, also roughly following the order suggested at:
https://tools.ietf.org/html/rfc2253

Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2020-05-11 17:41:11 -07:00
Ivan Kozlovic
1cf21fc4ee Fix some leafnode test flappers
Make use of some existing helpers and add checkFor in some places
since accounting updates may not be instantaneous.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-04-15 15:15:26 -06:00
Derek Collison
a301d6731b Re-order client close
Signed-off-by: Derek Collison <derek@nats.io>
2020-04-14 09:54:57 -07:00
Derek Collison
aff10aa16b Fix for #1344
Signed-off-by: Derek Collison <derek@nats.io>
2020-04-14 09:26:35 -07:00
Derek Collison
ef85a1b836 Fix for #1336
Signed-off-by: Derek Collison <derek@nats.io>
2020-04-10 17:30:03 -07:00
Matthias Hanel
e8ce738808 Test of service across accounts and leaf node. Tests #1336
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-04-10 15:55:10 -04:00
Derek Collison
f9d9ac193a Use prefix to make sure we use right subject
Signed-off-by: Derek Collison <derek@nats.io>
2020-04-10 10:49:05 -07:00
Derek Collison
090abc939d Fix for stream imports and leafnodes, #1332
Signed-off-by: Derek Collison <derek@nats.io>
2020-04-10 10:36:20 -07:00
Derek Collison
e843a27bba When a responder was on a leaf node and the requestor was connected to the same server as the leafnode we did not propagate the service reply wildcard properly. This fixes that.
Signed-off-by: Derek Collison <derek@nats.io>
2020-04-10 08:35:09 -07:00
Derek Collison
699502de8f Detection for loops with leafnodes.
We need to send the unique LDS subject to all leafnodes to properly detect setups like triangles.
This will have the server who completes the loop be the one that detects the error soley based on
its own loop detection subject.

Otehr changes are just to fix tests that were not waiting for the new LDS sub.

Signed-off-by: Derek Collison <derek@nats.io>
2020-04-08 20:00:40 -07:00
Derek Collison
82f585d83a Updated to also resend leafnode connect on GW connect via first INFO
Signed-off-by: Derek Collison <derek@nats.io>
2020-04-08 09:55:19 -07:00
Derek Collison
43fbe0ffed This commit allows new servers ina supercluster to be informed of accounts with active leafnode connections.
This is needed to put those accounts into interest only mode for inbound gateway connections. Also added code
to make sure we were doing proper account tracking and would track the global account as well, which used to
be excluded.

Fixes #977

Signed-off-by: Derek Collison <derek@nats.io>
2020-04-07 16:22:15 -07:00
Ivan Kozlovic
a19dcbee2d Release v2.1.6
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-03-31 10:29:06 -06:00
Matthias Hanel
6f77a54118 [FIXED] loop detection by checking for duplicate lds subscriptions
This is in addition to checking if the own subscription comes back.
The duplicated lds subscription must come from a different client.
Added unit tests.
Also prefixed lds with '$' to mark it as system subject going forward.

This moves the loop detection check past other checks.
These checks should not trigger in cases where a loop is initially detected.

Fixes #1305

Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-03-17 19:06:35 -04:00
Ivan Kozlovic
8a5b9269d7 Merge pull request #1301 from nats-io/ulimit-unittest
Modifying unit test error message to hint at ulimit -n possibly being too low
2020-03-04 12:52:15 -07:00
Matthias Hanel
68efc95a60 Modifying unit test error message to hint at ulimit -n possibly being too low
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-03-04 14:30:35 -05:00
Matthias Hanel
a8e6af30a3 On client connect, send first ping after ping interval.
On connect message resend reset timer with setFirstPingTimer, so RTT can
be obtained quicker.

Disable short first ping in default server options for client_test.
In log_test prevent immediate scheduling by setting ping interval.

Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-03-02 20:10:15 -05:00
Ivan Kozlovic
7ab9c76f2b Fixed benchmark tests to be able to run with Go 1.13+
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-02-26 12:12:18 -07:00
Ivan Kozlovic
8e4b449119 Fixed flappers
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-02-19 13:19:08 -07:00
Ivan Kozlovic
47b08335a4 [FIXED] Reset of tlsName only for x509.HostnameError
For issue #1256, we cleared the possibly saved tlsName on Hanshake failure.
However, this meant that for normal use cases, if a reconnect failed for
any reason we would not be able to reconnect if it is an IP until we get
back to the URL that contained the hostname.

We now clear only if the handshake error is of x509.HostnameError type,
which include errors such as:
```
"x509: Common Name is not a valid hostname: <x>"
"x509: cannot validate certificate for <x> because it doesn't contain any IP SANs"
"x509: certificate is not valid for any names, but wanted to match <x>"
"x509: certificate is valid for <x>, not <y>"
```

Applied the same logic to solicited gateway connections, and fixed the fact
that the tlsConfig should be cloned (since we set the ServerName).

I have also made a change for leafnode connections similar to what we are
doing for gateway connections, which is to use the saved tlsName only if
tlsConfig.ServerName is empty, which may not be the case for users that
embed NATS Server and pass directly tls configuration. In other words,
if the option TLSConfig.ServerName is not empty, always use this value.

Relates to #1256

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-01-28 13:16:38 -07:00
Derek Collison
643e73c0c5 Fix for #1256, mixed IP and DNS for cluster and TLS with leafnodes
Signed-off-by: Derek Collison <derek@nats.io>
2020-01-22 11:25:09 -08:00
Ivan Kozlovic
bdd7fa86e9 Update flapping test
We need to wait for the route close to be processed before attempting
to recreate it.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-01-10 12:01:59 -07:00
Ivan Kozlovic
c097357b52 [FIXED] More than expected switch to Interest-Only mode for account
When an account is switched to interest-only mode due to no interest,
it was not possible to switch that account more than once. But the
function switchAccountToInterestMode() that triggers a switch could
possibly doing it more than once. This should not cause problems
but increased the number of traces in a big super cluster.

Also fixed some flappers and a data race.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-01-09 13:35:08 -07:00
Ivan Kozlovic
b42856afa2 Set expectConnect flag for CLIENT only if auth required
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-01-07 10:48:11 -07:00
Ivan Kozlovic
c73be88ac0 Updated based on comments
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-01-06 16:57:48 -07:00