Commit Graph

2739 Commits

Author SHA1 Message Date
Waldemar Quevedo
ed81f84ce5 test: Use lame duck and wait shutdown on JS tests
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2021-04-14 10:34:11 -07:00
Derek Collison
1127c5d771 Bump Version
Signed-off-by: Derek Collison <derek@nats.io>
2021-04-13 20:08:29 -07:00
Derek Collison
f6a82a7c98 When messages were no longer available in an upstream stream a mirror could wedge and not resolve.
This fixes that scenario by detecting the situation and inserting skip msgs to catch up.

Signed-off-by: Derek Collison <derek@nats.io>
2021-04-13 11:46:03 -07:00
Derek Collison
90989d57d6 Change to report total deleted by default for stream info.
Allow deleted details if requested.

Signed-off-by: Derek Collison <derek@nats.io>
2021-04-12 18:10:11 -07:00
Derek Collison
6788c757d1 Merge pull request #2108 from nats-io/lnjs
Improve JS when a leafnode cluster extends and shares a system account.
2021-04-12 17:24:13 -07:00
Matthias Hanel
9486722e96 [fixing] subscription issue when subscribing to a super set of deny_import
If the subscription was foo. > but the server also had an import deny of foo.bar
It was legal to send the subscription. But the other server was unaware
of the restriction and sent the message anyway. The check of the
incoming message did not happen.

Fixing by ignoring messages the server is not supposed to receive.
And exchange deny_import so that the non soliciting leaf node knows to not
send these messages in the first place.

NB. merging of deny_ export/import with perms from INFO happens in processLeafnodeInfo

Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-04-12 20:09:55 -04:00
Derek Collison
755ef74855 When a cluser of leafnodes connects to a cluster or supercluster hub and they share the system account make the leafnode servers observers.
Signed-off-by: Derek Collison <derek@nats.io>
2021-04-12 17:00:55 -07:00
Derek Collison
8645935ccd Bump version
Signed-off-by: Derek Collison <derek@nats.io>
2021-04-12 11:43:11 -07:00
Derek Collison
e00cbf4927 Merge pull request #2105 from nats-io/interest_delete
Pull based consumers when deleted were not removing messages from an interest retention stream.
2021-04-12 11:41:37 -07:00
Derek Collison
c63f1d78b2 Merge pull request #2104 from nats-io/pbug2
Make sure we do not set last to -1
2021-04-12 11:19:09 -07:00
Derek Collison
f893345b40 Pull based consumers when deleted were not removing messages from an interest based stream.
Fix for #2097.

Signed-off-by: Derek Collison <derek@nats.io>
2021-04-12 11:16:31 -07:00
Derek Collison
bbb03af442 Make sure we do not set last to -1. #2068
Signed-off-by: Derek Collison <derek@nats.io>
2021-04-12 11:01:41 -07:00
Waldemar Quevedo
8daf6e4995 Make SIGTERM exit 1
Before 2.2 series, the TERM signal used to not be handled
by the server, so it would not have been a clean exit.
In 2.2, it was changed to process TERM signal as a clean exit
but this affects the behavior of some tools that were expecting
TERM to be exit 1.

Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2021-04-12 10:17:13 -07:00
Ivan Kozlovic
9d8ea6b64a Merge pull request #2102 from nats-io/fix_leafnode_flapper
Fixed leafnode flapper
2021-04-12 09:59:36 -06:00
Derek Collison
66b0c5c216 Merge pull request #2100 from nats-io/csz
Only adjust cluster size when we have heard from all peers.
2021-04-12 08:52:07 -07:00
Derek Collison
cb55e163a5 Merge pull request #2098 from nats-io/mixedmode
Add mixedmode test back in
2021-04-12 08:48:43 -07:00
Ivan Kozlovic
c369a26c03 Fixed leafnode flapper
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-04-12 09:31:33 -06:00
Derek Collison
0cee993e3b When checking cluster size we need to make sure we have heard from all peers before making adjustments.
Also check back periodically.

Signed-off-by: Derek Collison <derek@nats.io>
2021-04-10 15:55:51 -07:00
Derek Collison
e0eaf704dc Partial fix for #2068.
This will not protect against the index file being completely removed.

Signed-off-by: Derek Collison <derek@nats.io>
2021-04-10 12:46:31 -07:00
Derek Collison
2bc4bf19a7 Make sure to clean up directories
Signed-off-by: Derek Collison <derek@nats.io>
2021-04-10 10:25:12 -07:00
Derek Collison
833279388b Add mixedmode test back in
Signed-off-by: Derek Collison <derek@nats.io>
2021-04-10 10:10:37 -07:00
Derek Collison
69269c5653 Merge pull request #2095 from nats-io/mixed
Mixed mode improvements.
2021-04-09 16:56:41 -07:00
Derek Collison
27d8b939b5 Updated based on comments that the one fix was actually a misconfiguration.
Signed-off-by: Derek Collison <derek@nats.io>
2021-04-09 16:49:24 -07:00
Jaime Piña
27e9628c3a Run gofmt -s to simplify code 2021-04-09 15:18:06 -07:00
Derek Collison
e438d2f5fa Mixed mode improvements.
1. When in mixed mode and only running the global account we now will check the account for JS.
2. Added code to decrease the cluster set size if we guessed wrong in mixed mode setup.

Signed-off-by: Derek Collison <derek@nats.io>
2021-04-09 14:58:35 -07:00
Matthias Hanel
da4430fc8d using clearTimer(&c.ping.tmr) for cleanup
Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-04-09 16:53:06 -04:00
Matthias Hanel
f7a772f097 Ensure that leafNodeFinishConnectProcess is only executed once.
incorporate review comments

Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-04-09 16:53:06 -04:00
Matthias Hanel
5d1f36dd17 [Fixed] leaf node subscription permission negotiation.
On connect all subscription where sent by the soliciting leaf node.
If creds contains sub deny permissions, the leaf node would be
disconnected.
This waits for the permissions to be exchanged and checks permissions
before sending subscriptions.

Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-04-09 16:53:06 -04:00
Derek Collison
112257d09d Merge pull request #2089 from nats-io/flappers
Fix flappers
2021-04-09 08:54:24 -07:00
Derek Collison
3c051d461c Fix flappers
Signed-off-by: Derek Collison <derek@nats.io>
2021-04-08 18:03:14 -07:00
Ivan Kozlovic
6fef6456e8 Merge pull request #2088 from nats-io/fix_leafnode_first_ping
[FIXED] LeafNode: set first ping timer after receiving CONNECT
2021-04-08 17:53:06 -06:00
Ivan Kozlovic
666eea5b95 Merge pull request #2087 from nats-io/fix_tmp_pid_file
Fixed expected pid path in options
2021-04-08 16:10:04 -06:00
Derek Collison
1c368973c8 Merge pull request #2086 from alexpantyukhin/fix_max_bytes_check_memstore
fix for memstore storeRawMsg be consistent with filestore
2021-04-08 14:48:56 -07:00
Ivan Kozlovic
a7e5853a3c Fixed expected pid path in options
This was introduced by PR #2071.

On some tests, options are loaded based on a config file that has
the pid set to "/tm/nats-server/nats-server.pid", however, the
expected option's pid path was set based on tmpRoot. The problem
is that on macOS, that value would be "/var/folders/xxx" which
would not match.
So this PR simply reverts the changes to the expected pid file
name: it simply needs to match was in the test.conf file.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-04-08 15:08:23 -06:00
Ivan Kozlovic
452685b9b1 [FIXED] LeafNode: set first ping timer after receiving CONNECT
We were setting the ping timer in the accepting server as soon
as the leafnode connection is created, just after sending
the INFO and setting the auth timer.

Sending a PING too soon may cause the solicit side to process
this PING and send a PONG in response, possibly before sending
the CONNECT, which the accepting side would fail as an authentication
error, since first protocol is expected to be a CONNECT.

Since LeafNode always expect a CONNECT, we always set the auth
timer. So now on accept, instead of starting the ping timer just
after sending the INFO, we will delay setting this timer only
after receiving the CONNECT.

The auth timer will take care of a stale connection in the time
it takes to receives the CONNECT.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-04-08 14:36:39 -06:00
alexpantyukhin
ce34266912 fix for memstore storeRawMsg be consistent with filestore 2021-04-08 23:54:10 +04:00
Derek Collison
deb015ec73 Fix for #2083 to release ack pending when messages expire or hit max redeliveries.
Signed-off-by: Derek Collison <derek@nats.io>
2021-04-08 11:47:59 -07:00
R.I.Pienaar
f2d1a173db expose the connection kind to CustomClientAuthentication
Signed-off-by: R.I.Pienaar <rip@devco.net>
2021-04-08 18:33:55 +02:00
Ivan Kozlovic
c7f8296a85 Merge pull request #2065 from alexpantyukhin/extract_server_update
extract_server_update
2021-04-08 09:01:51 -06:00
alexpantyukhin
e16bebb8df extract update remote subscription. 2021-04-08 16:37:12 +04:00
Derek Collison
6024c85c09 Bump to 2.2.2-beta
Signed-off-by: Derek Collison <derek@nats.io>
2021-04-07 17:44:30 -07:00
Derek Collison
a5440f4ae7 Merge pull request #2080 from nats-io/compact_bug
Fix bug that could cause panic and corruption on filestore compact.
2021-04-07 15:38:42 -07:00
Derek Collison
16941c78a0 Merge pull request #2076 from nats-io/account_load
Report an error if we fail to load an account on a stream assignment.
2021-04-07 14:40:27 -07:00
Derek Collison
98f099002d Merge pull request #2081 from nats-io/quiet_race
Quiet race detector
2021-04-07 14:40:02 -07:00
Derek Collison
bfb482121d In some scenarios compact could count messages it should not and make mb.msgs go negative which meant max uint64.
Signed-off-by: Derek Collison <derek@nats.io>
2021-04-07 14:39:23 -07:00
Derek Collison
2bea1f64f5 Merge pull request #2078 from nats-io/mirror_panic
If a mirror was removed or changed this would panic.
2021-04-07 14:26:56 -07:00
Derek Collison
1b5f0edbab Quiet race detector
Signed-off-by: Derek Collison <derek@nats.io>
2021-04-07 14:25:21 -07:00
Derek Collison
1ea4a430da If we fail to load an account while processing a stream assignment, send error back to metaleader.
Signed-off-by: Derek Collison <derek@nats.io>
2021-04-07 14:23:12 -07:00
Derek Collison
74a051e3a8 Merge pull request #2075 from nats-io/startup
Optimize startup for filtered consumers when creating pending count.
2021-04-07 14:16:32 -07:00
Ivan Kozlovic
f96f36c73d [FIXED] Websocket: TLS configuration not updated on reload
Although we do not support websocket configuration changes, we usually
try to support changes to TLS certificates, etc..

The way websocket is handled (using an http server), the TLS config
was given on startup and updates following a configuration reload
would not be reflected.
Using a tls.Config function that allows passing the tls config
prior to handshake seem to workaround this issue.

I have added a test that demonstrate that the TLS configuration
is really updated after the reload.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-04-07 13:58:35 -06:00