Commit Graph

4342 Commits

Author SHA1 Message Date
Derek Collison
3ac6052b32 Updated pae threshold and reporting modulo to not spam logs as much.
Signed-off-by: Derek Collison <derek@nats.io>
2022-11-11 16:08:58 -08:00
Ivan Kozlovic
da287b0aea [FIXED] Weighted subject mappings updates not applied
Suppose an account is updated to have the following weighted mapping:
```
foo -> bar 40%
```
The server automatically adds foo -> foo at 60%. Sending messages
to "foo" will result in the expected distribution of 60% messages
going to "foo" and 40% going to bar.

However, if a successive update is pushed to the server(s):
```
foo -> bar 40%
foo -> baz 60%
```
The subject mapping should now be as described, that is, no more
mapping from "foo" to "foo" and 40% to bar and 60% to baz, however,
what was happening is that the server would always use the original
mapping.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-11-11 15:45:32 -07:00
Derek Collison
4dab6ce92c Fix test timing
Signed-off-by: Derek Collison <derek@nats.io>
2022-11-09 19:44:22 -08:00
Ivan Kozlovic
304744ce08 Merge pull request #3615 from nats-io/js_acc_max_streams_consumers
[FIXED] JetStream: Account max streams/consumers not always honoured
2022-11-09 18:02:51 -07:00
Ivan Kozlovic
1b892837cb [FIXED] JetStream: Account max streams/consumers not always honoured
This could happen during concurrent requests where the assignments
are not yet fully processed.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-11-09 17:29:20 -07:00
Derek Collison
e008e015b3 Make sure to enforce HA asset limits during peer processing as well as assignment.
Signed-off-by: Derek Collison <derek@nats.io>
2022-11-09 16:24:54 -08:00
Ivan Kozlovic
3ec42d5b85 Updates to PR #3611
- Save the TLS name only if not already set
- Use the passed URLs slice instead of using s.getOpts().Routes
- Enhanced the test
- Fixed an unrelated DATA RACE report

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-11-08 09:36:08 -07:00
Ivan Kozlovic
2d181e1c27 [FIXED] Routing: TLS connections to discovered server may fail
The server was not setting "server name" in the TLS configuration
for route connections, which may lead to failed (re)connect if
the certificate does not allow for the IP and the URL did not
have the hostname, which would happen with gossip protocol.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-11-07 17:26:17 -07:00
Derek Collison
c6031382a1 Fix for #3499
When we deleted a consumer from an interest policy stream we would make sure to clean up any unacked messages.
However we only based start from the ack floor for the consumer and did not take into account the first sequence of the stream.

Signed-off-by: Derek Collison <derek@nats.io>
2022-11-05 13:56:45 -07:00
Ivan Kozlovic
ef00281bc2 Bump to v2.9.7-beta as per release process
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-11-04 10:46:45 -06:00
Ivan Kozlovic
00a7b4af1e Release v2.9.6
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-11-04 09:44:54 -06:00
Ivan Kozlovic
ca237bdfa0 [FIXED] JetStream: Stream scale down while it has no quorum
If a stream R2 had one of its server network-partitioned and at
that time the stream was edited to be scaled down to an R1 it
would cause the stream to no longer have quorum even when the
network partition is resolved.

Signed-off-by: Derek Collison <derek@nats.io>
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-11-04 09:08:31 -06:00
Ivan Kozlovic
c16ccd34c3 [FIXED] JetStream: Sources with OptStartTime gets redelivered
If start by time is before what we remember during recovery use that instead

Resolves #3559

Signed-off-by: Derek Collison <derek@nats.io>
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-11-03 16:09:06 -06:00
Derek Collison
c9fd776889 Merge pull request #3605 from nats-io/fix-3606
[FIXED] Notifying waiting pull consumers on consumer or parent stream deletion.
2022-11-03 13:05:47 -07:00
Derek Collison
72ff2edb5f Fix for #3603.
Signed-off-by: Derek Collison <derek@nats.io>
2022-11-03 12:46:41 -07:00
Ivan Kozlovic
91c84c03c2 [FIXED] LeafNode: possible duplicate messages in complex setup
This is specific to setup described [here](https://github.com/nats-io/nats-server/issues/3191#issuecomment-1296974382)
and does not require JetStream to be reproduced. The added test
reproduces the above setup but without JetStream enabled in
the accounts.

Each cluster has a leafnode for a given account to the other
cluster. The accounts import/export a subject. When a consumer
is connected to cluster "B" and the producer is on cluster "A"
there was a duplicate message. Due to shadow subscription caused
by the import/export rules, an additional subscription was
sent across the leafnode.

Resolves #3191

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-11-03 12:34:01 -06:00
Derek Collison
56919ebc97 On stream proposal failures we could accidentally warn on high stream lag.
We were not taking the clfs into account.

Signed-off-by: Derek Collison <derek@nats.io>
2022-11-02 14:40:31 -07:00
Ivan Kozlovic
ab4470ccdc [FIXED] JetStream: possible panic on some rare cases
Very difficult to reproduce. Had to run TestJetStreamSuperClusterMoveCancel
in covermode=atomic on a slow machine to hit the condition where
the monitorConsumer go routine is started by RAFT node is nil,
which caused the warning message to produce the panic (since n is nil)

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-11-02 10:02:09 -06:00
Ivan Kozlovic
2321eafb0c Bump version to 2.9.6-beta as per release process
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-11-01 16:23:50 -06:00
Ivan Kozlovic
c16f60add5 Release v2.9.5
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-11-01 15:15:06 -06:00
Ivan Kozlovic
55e651c118 [FIXED] JetStream: processing of snapshot with expired messages
The issue that a "first sequence mismatch" during processing of
a snapshot was causing the state to be reset and caused a lot
of catchup from the follower. An attempt to fix that in PR #3567
caused an issue that was addressed in PR #3589. However, this was
then causing the follower to sometime never able to catchup or
took a very long time.
This PR - we believe - addresses the original and subsequent issues.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-11-01 12:58:45 -06:00
Derek Collison
1fa5e73177 Honor MaxMsgsPerSubject when a stream config is updated, including enforcing a lower limit.
Signed-off-by: Derek Collison <derek@nats.io>
2022-10-31 17:25:20 -07:00
Ivan Kozlovic
fe588dc9ea Fixing a flapper
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-10-28 13:45:58 -06:00
Александр Петров
8eb430bfff add test 2022-10-28 20:16:40 +05:00
Александр Петров
19f63bee65 less optimistic cache hit rate 2022-10-28 11:36:46 +05:00
Ivan Kozlovic
3f0f3d7416 Bump version to 2.9.5-beta.1
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-10-27 19:15:01 -06:00
Derek Collison
121bf6ebb5 Move to past check for nil
Signed-off-by: Derek Collison <derek@nats.io>
2022-10-27 17:30:07 -07:00
Ivan Kozlovic
3a5f465115 Bump to 2.9.5-beta as per release process
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-10-27 17:15:00 -06:00
Ivan Kozlovic
f101e815fe Release v2.9.4
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-10-27 16:10:39 -06:00
Derek Collison
bd1df4bfd5 Bump to 2.9.4-RC.3
Signed-off-by: Derek Collison <derek@nats.io>
2022-10-27 13:21:08 -07:00
Derek Collison
95d91b2869 Merge pull request #3585 from nats-io/leaf-perms
[FIXED] Existing subs would be sent to leafnodes even though they violated permissions.
2022-10-27 15:19:48 -05:00
Ivan Kozlovic
abcfe2e7ac Add the pending msgs/bytes on 409 Shutdown
This is related to PR #3572 and PR #3576

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-10-27 13:59:21 -06:00
Derek Collison
9c5ae6baef Existing subs would be sent to leafnodes even though pub perms should disallow.
If the LS+ gets through we debug that it was denied, but also fixed it so that does not happen.

Signed-off-by: Derek Collison <derek@nats.io>
2022-10-27 12:31:57 -07:00
Derek Collison
24081ae78e Bump to 2.9.4-RC.2
Signed-off-by: Derek Collison <derek@nats.io>
2022-10-27 09:19:22 -07:00
Derek Collison
d89992990b Merge pull request #3582 from nats-io/fix
Make sure to check for ss == nil
2022-10-27 11:07:11 -05:00
Derek Collison
8f6d55a878 Make sure to check for ss == nil
Signed-off-by: Derek Collison <derek@nats.io>
2022-10-27 08:52:42 -07:00
Ivan Kozlovic
b3e0431959 [FIXED] allow_non_tls is lost after server reload
The server would reset its INFO's TLSRequired to the presence
of a TLS configuration without checking for the allow_non_tls
option.

Resolves #3581

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-10-27 09:49:44 -06:00
Derek Collison
8cc87c988f Bump to 2.9.4-RC.1
Signed-off-by: Derek Collison <derek@nats.io>
2022-10-26 17:52:28 -07:00
Derek Collison
6128b83507 On abnormal server exit, for streams or KV with max msgs per subject set we could recover more than N msgs per subject.
This fix allows for recover of correct state on restart when index files are missing or not current.

Signed-off-by: Derek Collison <derek@nats.io>
2022-10-26 16:00:57 -07:00
Tomasz Pietrek
f0219e1d95 Merge pull request #3572 from nats-io/jarema/add-pending-info-to-request-timeout
Added pending messages/bytes info to request statuses and errors
2022-10-26 21:20:20 +02:00
Tomasz Pietrek
ef764598ee Add pending messages/bytes info to request errors and statuses
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
2022-10-26 20:02:11 +02:00
Derek Collison
2241ad089e Make local error since non-fatal for now.
Signed-off-by: Derek Collison <derek@nats.io>
2022-10-25 16:56:10 -07:00
Derek Collison
aa52c2fecf Added warning for high message lag into a clustered stream.
Signed-off-by: Derek Collison <derek@nats.io>
2022-10-25 16:11:35 -07:00
Derek Collison
db13766f18 Merge pull request #3576 from nats-io/signal-pull-consumers
Removed ephemeral consumer migration.
2022-10-25 17:35:35 -05:00
Derek Collison
f0afa49b9f Make sure to stop raft nodes on all monitor exits.
Signed-off-by: Derek Collison <derek@nats.io>
2022-10-25 14:48:28 -07:00
Derek Collison
ff2cd1d7f9 Fixed test and bug that would override consumer replicas.
Signed-off-by: Derek Collison <derek@nats.io>
2022-10-25 14:35:20 -07:00
Derek Collison
15dc72db50 Removed migration of ephemerals, added proper signaling for pul consumers pending requests.
Signed-off-by: Derek Collison <derek@nats.io>
2022-10-25 14:35:20 -07:00
Ivan Kozlovic
39f31b0dbe [FIXED] JetStream: InactivityThreshold updates not always working
This is based of @neilalexander PR #3558.

It ensures that the timer is reset/canceled on configuration
update (by the leader only).

Fixed also the issue with a super-cluster where the delete timer
would always be reset at every gateway interval check.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-10-25 09:54:01 -06:00
Ivan Kozlovic
7ca85e0e80 [FIXED] JetStream: Update of an R1 consumer would not get a response
The update was accepted but the server would not respond to the
client/CLI.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-10-25 09:04:35 -06:00
Ivan Kozlovic
6113c52ae1 [FIXED] Solicited route may not retry to reconnect
Originally, only solicited routes were retried in case of a disconnect,
but that was before gossip protocol was introduced. Since then, two
servers that connect to each other due to gossip should retry to
reconnect if the connection breaks, even if the route is not explicit.
However, server will retry only once or more accurately, ConnectRetries+1.

This PR solves the issue that the reconnect attempt was not initiated
for a "solicited route" that was not explicit.

Maybe related to #3571

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-10-24 10:39:23 -06:00