Commit Graph

7481 Commits

Author SHA1 Message Date
Byron Ruth
d284298915 Release v2.9.22
Signed-off-by: Byron Ruth <byron@nats.io>
2023-09-06 16:08:07 -04:00
Waldemar Quevedo
fd50e79da7 Revert "Enables 0s deduplication window duration when the stream has sources" (#4495)
This reverts commit db96238ad9 which was
causing `TestNoRaceJetStreamSuperClusterSources` to fail sometimes with
duplicate messages around shutdown.
2023-09-06 12:53:40 -07:00
Waldemar Quevedo
e1574eca3e Revert "Enables 0s deduplication window duration when the stream has sources (#4476)"
This reverts commit db96238ad9.
2023-09-06 11:51:38 -07:00
Byron Ruth
f650e1ad07 Pin Go version in Travis config (#4494) 2023-09-06 13:29:15 -04:00
Byron Ruth
d29df72f83 Pin Go version in Travis config
Signed-off-by: Byron Ruth <byron@nats.io>
2023-09-06 13:20:10 -04:00
Waldemar Quevedo
8390a4714c v2.9.x: Change CI and nightlies to use Go 1.20 (#4487)
Includes fix for test `TestGatewayTLSMixedIPAndDNS ` that was breaking
in Go 1.20.
2023-09-04 13:33:22 -07:00
Waldemar Quevedo
7a2020a347 Remove Go 1.19 build
Signed-off-by: Waldemar Quevedo <wally@nats.io>
2023-09-04 12:55:06 -07:00
Waldemar Quevedo
d8bdbc34c4 Fix resetting TLS name from solicited remotes
In +Go 1.20, the x509.HostnameError changed to be wrapped in a
tls.CertificateVerificationError so sometimes the name would not
be reset.

This would make the `TestGatewayTLSMixedIPAndDNS` test flake sometimes.

Signed-off-by: Waldemar Quevedo <wally@nats.io>
2023-09-04 11:50:55 -07:00
Sylvain Rabot
a6f7f5476e Bump v2.9 CI and nightlies to Go 1.20
Signed-off-by: Waldemar Quevedo <wally@nats.io>
2023-09-04 11:43:22 -07:00
Derek Collison
8b35c01637 [FIXED] Fix for a bug that would make normal streams use the wrong block size. (#4478)
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-02 14:14:50 -07:00
Derek Collison
34ae2bf4cb Fix for a bug that would make normal streams use the wrong block size.
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-02 13:56:34 -07:00
Derek Collison
b63318c0c9 Bump to 2.9.22-RC.5
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-02 12:00:39 -07:00
Derek Collison
f61ad322c9 [FIXED] Interface conversion bug for ipQueues in monitor which would cause panics. (#4477)
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-02 12:00:07 -07:00
Derek Collison
2c81224262 Fixed interface conversion for ipQueue in monitor which caused panics.
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-02 11:43:08 -07:00
Derek Collison
7f13ecc87b Refine core and TLS benchmarks (#4475)
- [ ] Link to issue, e.g. `Resolves #NNN`
 - [ ] Documentation added (if applicable)
 - [x] Tests added
- [x] Branch rebased on top of current main (`git pull --rebase origin
main`)
- [ ] Changes squashed to a single commit (described
[here](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html))
 - [ ] Build is green in Travis CI
- [x] You have certified that the contribution is your original work and
that you license the work to the project under the [Apache 2
license](https://github.com/nats-io/nats-server/blob/main/LICENSE)

Related: https://github.com/nats-io/nats-server/pull/4399

### Changes proposed in this pull request:

 - Avoid binding to hardcoded port, as it may conflict if already in use
- Drop TLS from Core Request/Response benchmark, was not showing much
difference, not enough data going through to become a dominant cost
- Add a different core benchmark that exercises TLS by pushing through
lots of data
2023-09-01 13:58:27 -07:00
Marco Primi
e61e40e3fe Add benchmark for TLS content encryption overhead 2023-09-01 12:58:52 -07:00
Marco Primi
4eedfe8d0c Simplify core request/response benchmark
- Remove TLS, impact is negligible for the amount of data pushed
through
 - Rename benchmark
2023-09-01 12:58:52 -07:00
Marco Primi
bbf42c1f57 Use dynamic port number in benchmark 2023-09-01 12:58:52 -07:00
Jean-Noël Moyne
db96238ad9 Enables 0s deduplication window duration when the stream has sources (#4476)
- [X] Link to issue, e.g. `Resolves #NNN`
- [X] Branch rebased on top of current main (`git pull --rebase origin
main`)
- [X] Changes squashed to a single commit (described
[here](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html))
 - [X] Build is green in Travis CI
- [X] You have certified that the contribution is your original work and
that you license the work to the project under the [Apache 2
license](https://github.com/nats-io/nats-server/blob/main/LICENSE)

Resolves #4459

Allows the user to set the deduplication window duration to 0s when the
stream has sources defined. Remember that if the stream in question is
also listening on subjects as well as sourcing the deduplication window
is the same for sourced and listened messages.

---------

Signed-off-by: Jean-Noël Moyne <jnmoyne@gmail.com>
2023-09-01 12:47:14 -07:00
Derek Collison
c9e0de3358 Update to dependencies (#4474)
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-01 10:12:10 -07:00
Derek Collison
c3648d27bd Update to dependencies
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-01 09:54:16 -07:00
Derek Collison
aca74d0b27 Bump to 2.9.22-RC.4
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-01 09:44:53 -07:00
Waldemar Quevedo
ed8b50d943 Fix monitoring server connz idle time sorting (#4463)
- Changed how [`byIdle`](887a4ae692/server/monitor_sort_opts.go (L97))
struct compares the idle times (was subtracting the start time from the last activity time).

 - Added tests for `byIdle`.

- Changed and simplified the test
[`TestConnzSortedByIdle`](8a9f441c40/server/monitor_test.go (L1185))
(No need for the clients to publish and subscribe if we are manually
changing the client's `last` time, and we only need to test the sorting
order). Also the test was not catching the problem because the clients
`start` time was the same, now every client has a different start time.

Resolves #4462
2023-09-01 09:44:19 -07:00
Derek Collison
f6aaea195e [FIXED] We should update accounting before clearing ebit (#4473)
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-01 09:43:11 -07:00
Derek Collison
4422a95a8e We should update accounting before clearing ebit
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-01 09:31:12 -07:00
Derek Collison
a2373d9162 [IMPROVED] Consumer failing to deliver re-adjusts delivered count and any waiting request. (#4472)
When we fail to deliver a message for a consumer, either through
didNotDeliver() or LoadMsg() failure re-adjust delivered count and
waitingRequest accounting.

Signed-off-by: Derek Collison <derek@nats.io>
2023-09-01 09:30:22 -07:00
Derek Collison
c679f9d7f6 Added in detail info when failing to load in a message for a consumer.
E.g. `Unexpected partial cache error looking up message for consumer '$G > TEST > dlc'`

Signed-off-by: Derek Collison <derek@nats.io>
2023-09-01 09:06:29 -07:00
Derek Collison
3a39786972 When we fail to deliver a message for a consumer, either through didNotDeliver() or LoadMsg() failure re-adjust delivered count and waitingRequest accounting.
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-01 08:48:28 -07:00
Pierre Mdawar
d24d51292f Fix monitoring server connz idle time sorting 2023-09-01 14:32:08 +03:00
Derek Collison
45e6812d70 [FIXED] Sending too fast to have replicas be caught up enough to register directs. (#4468)
Signed-off-by: Derek Collison <derek@nats.io>
2023-08-31 15:43:14 -07:00
Derek Collison
afb052651a Sending too fast to have replicas be caught up enough to register direct subs
Signed-off-by: Derek Collison <derek@nats.io>
2023-08-31 15:16:19 -07:00
Derek Collison
d7ea3b94d9 [FIXED] Check for checksum violations for all records and before any sequence processing. (#4465)
Also small bug fix for leaking fds under certain scenarios during
corruption.

Signed-off-by: Derek Collison <derek@nats.io>
2023-08-31 15:08:04 -07:00
Derek Collison
a45281d51f Added check to test
Signed-off-by: Derek Collison <derek@nats.io>
2023-08-31 14:00:14 -07:00
Pierre Mdawar
6d6d3cfa55 Fix Content-Type header in /healthz when status is not 200 OK (#4437)
- Added a new internal function `handleResponse` that accepts the HTTP 
  status code and sets it after setting the headers
- Added tests for the `/healthz` endpoint for the `ok`, `error` and `unavailable` statuses
- Changed the IETF API health check URL to 
https://datatracker.ietf.org/doc/html/draft-inadarei-api-health-check

Resolves #4436
2023-08-31 13:55:20 -07:00
Derek Collison
c110ceea94 Check for checksum violations for all records and before sequence processing.
Also fix for bitrot test and a small bug fix for a leaking fd.

Signed-off-by: Derek Collison <derek@nats.io>
2023-08-31 13:53:28 -07:00
Waldemar Quevedo
76c3942609 Fix leaf connection missing LS+ sometimes (#4464)
`TestNoRaceLeafNodeSmapUpdate` could occasionally fail with missing
`LS+` commands due not capturing all the inflight SUB commands as they
were being processed outside the client lock.
2023-08-31 11:18:00 -07:00
Ivan Kozlovic
9a9e84ea5c Fix leaf connection missing LS+ sometimes
Signed-off-by: Waldemar Quevedo <wally@nats.io>
2023-08-31 10:06:02 -07:00
Derek Collison
2834142bdd Revert lock guard
Signed-off-by: Derek Collison <derek@nats.io>
2023-08-31 08:59:15 -07:00
Derek Collison
8a9f441c40 Bump to 2.9.22-RC.3
Signed-off-by: Derek Collison <derek@nats.io>
2023-08-31 08:33:22 -07:00
Derek Collison
887a4ae692 [FIXED] Unlock needed to be guarded, could deadlock filestore (#4461)
Needed to check guard for unlock here.

Signed-off-by: Derek Collison <derek@nats.io>
2023-08-31 08:24:08 -07:00
Derek Collison
2b677c231a Unlock needed to be guarded
Signed-off-by: Derek Collison <derek@nats.io>
2023-08-31 08:16:47 -07:00
Derek Collison
2e1392a234 [FIXED] potential message duplication from sources when downgrading back from 2.10 (#4454)
- [X] Changes squashed to a single commit (described
[here](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html))
 - [ ] Build is green in Travis CI
- [X] You have certified that the contribution is your original work and
that you license the work to the project under the [Apache 2
license](https://github.com/nats-io/nats-server/blob/main/LICENSE)

2.10 adds a couple space separated fields to the sourcing message header
from 2 to 4 but the current 2.9 code is too strict of checking the
number of fields is exactly 2 rather than at least 2
2023-08-30 16:21:59 -07:00
Derek Collison
415bbb2ee1 [FIXED] Make sure order correct (#4455)
Signed-off-by: Derek Collison <derek@nats.io>
2023-08-30 16:17:12 -07:00
Derek Collison
abae24086c Make sure order correct
Signed-off-by: Derek Collison <derek@nats.io>
2023-08-30 16:13:56 -07:00
Derek Collison
1de649a690 Remove OCSP debug log on reload (#4453)
When reloading TLS we would always be logging the attempt to plug OCSP:

```
[42801] 2023/08/30 14:52:33.766638 [INF] Reloaded: authorization users
[42801] 2023/08/30 14:52:33.766648 [INF] Reloaded: accounts
[42801] 2023/08/30 14:52:33.766652 [INF] Reloaded: tls = enabled
[42801] 2023/08/30 14:52:33.766756 [DBG] Plugging TLS OCSP peer for [Client]
[42801] 2023/08/30 14:52:33.766763 [INF] Reloaded server configuration
```
2023-08-30 16:05:24 -07:00
Derek Collison
3be9e97760 Bump to 2.9.22-RC.2
Signed-off-by: Derek Collison <derek@nats.io>
2023-08-30 15:32:31 -07:00
Derek Collison
774987cd99 [IMPROVED] Allow 2.10 tombstones to be skipped and allow us to recover on downgrade (#4452)
Also fixed small bug that could set bad first sequence for subject
tracking info.

Signed-off-by: Derek Collison <derek@nats.io>
2023-08-30 15:31:51 -07:00
Jean-Noël Moyne
003daf3db8 Fixes possible message duplication in sourcing streams if upgrading to 2.10 and then back down to 2.9
2.10 adds a couple space separated fields to the sourcing message header from 2 to 4 but the current 2.9 code is too strict of checking the number of fields is exactly 2 rather than at least 2

Signed-off-by: Jean-Noël Moyne <jnmoyne@gmail.com>
2023-08-30 15:27:26 -07:00
Waldemar Quevedo
4109e420d2 Remove ocsp debug log on reload
Signed-off-by: Waldemar Quevedo <wally@nats.io>
2023-08-30 14:54:30 -07:00
Derek Collison
8841432d03 Allow 2.10 tombstones to be skipped and allow us to recover on downgrade from 2.10 to 2.9.
Also fixed small bug that could set bad first seq.

Signed-off-by: Derek Collison <derek@nats.io>
2023-08-30 14:38:41 -07:00