Commit Graph

7349 Commits

Author SHA1 Message Date
Derek Collison
7feebb4f64 Bump to 2.9.21-RC.2
Signed-off-by: Derek Collison <derek@nats.io>
2023-07-28 09:55:45 -07:00
Derek Collison
c0fe4972f0 [FIXED] Stream recovery with corrupt msg block with sequence gaps. (#4344)
This is a fix for a bad msg blk detected in the field that had sequence
holes.

The stream had max msgs per subject of one and only one subject but had
lots of messages. The stream did not recover correctly, and upon further
inspection determined that a msg blk had holes, which should not be
possible.

We now detect the holes and deal with the situation appropriately.
Heavily tested on the data dump from the field.

Signed-off-by: Derek Collison <derek@nats.io>
2023-07-28 05:10:35 -07:00
Derek Collison
92430513d3 Add in const for msg record hash size
Signed-off-by: Derek Collison <derek@nats.io>
2023-07-28 04:35:33 -07:00
Derek Collison
21e3d7a512 This is a fix for a bad msg blk detected in the field that had sequence holes.
The stream had max msgs per subject of one and only one subject but had lots of messages.
The stream did not recover correctly, and upon further inspection determined that a msg blk had holes, which should not be possible.

We now detect the holes and deal with the situation appropriately.
Heavily tested on the data dump from the field.

Signed-off-by: Derek Collison <derek@nats.io>
2023-07-27 21:43:15 -07:00
Derek Collison
3a2835c3be Cherry-pick "Fix not validating single token filtered consumer" (#4338)
This cherry-picks #3776 into `main` for the next patch release.

Signed-off-by: Neil Twigg <neil@nats.io>
2023-07-26 22:26:58 -07:00
Derek Collison
865f12f396 Report correct consumer count in paged list response (#4339)
Previously the Total in paged responses would always equal the size of
the first response this would stall paged clients after the first page.

Now correctly sets the total so paging continues, improves the test to
verify these aspects of the report
2023-07-26 22:19:25 -07:00
R.I.Pienaar
60e67ff9a5 Report correct consumer count in paged list response
Previously the Total in paged responses would always equal the
size of the first response this would stall paged clients after
the first page.

Now correctly sets the total so paging continues, improves the
test to verify these aspects of the report

Signed-off-by: R.I.Pienaar <rip@devco.net>
2023-07-27 07:52:24 +03:00
Tomasz Pietrek
4b72e37f27 Fix not validating single token filtered consumer
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
Signed-off-by: Neil Twigg <neil@nats.io>
2023-07-26 16:21:00 +01:00
Waldemar Quevedo
45beab1f17 Fix typo from internal function (#4337)
minor internal typo fix
2023-07-25 06:56:23 -07:00
Derek Collison
0421c65c88 Bump to 2.9.21-RC.1
Signed-off-by: Derek Collison <derek@nats.io>
2023-07-23 14:58:52 -07:00
Derek Collison
4ee3408dfd [IMPROVED] Update dependencies (#4333)
Signed-off-by: Derek Collison <derek@nats.io>
2023-07-23 14:55:07 -07:00
Derek Collison
2e48b54d14 Update dependencies
Signed-off-by: Derek Collison <derek@nats.io>
2023-07-23 11:43:51 -07:00
Waldemar Quevedo
bbfeb2a887 Fix typo on internal function
Signed-off-by: Waldemar Quevedo <wally@nats.io>
2023-07-22 20:40:26 -07:00
Derek Collison
ac24110ac4 Include logtime_utc option into v2.9 series (#4331)
Includes option to log in UTC with commits from following PRs:

https://github.com/nats-io/nats-server/pull/3833
https://github.com/nats-io/nats-server/pull/3920
2023-07-21 18:37:05 -07:00
Byron Ruth
905f040d86 Change logtime_utc default to false
This ensures that the existing, default behavior of the server emitting the local timezone is not changed.
2023-07-21 16:57:12 -07:00
Neil Twigg
e88517c90e Add logtime_utc option
backport to main: https://github.com/nats-io/nats-server/pull/3833

Signed-off-by: Waldemar Quevedo <wally@nats.io>
2023-07-21 16:56:13 -07:00
Derek Collison
ba517e4bfb [FIXED] Leaking memory on usage of getHash() (#4329)
If we created lots of hashes, beyond server names, like for consumer or
stream NRG group names etc, these maps would grow and not release
memory. Performance hit is ~300ns per call, and we can use string intern
trick if need be at a future date since it is GC friendly.

Signed-off-by: Derek Collison <derek@nats.io>

Resolves #4289
2023-07-20 16:04:18 -07:00
Derek Collison
da60f2ab32 [IMPROVED] Don't error to server logs if message was deleted for consumer (#4328)
Signed-off-by: Derek Collison <derek@nats.io>
2023-07-20 15:20:11 -07:00
Derek Collison
b68aed90d3 If we created lots of hashes, beyond server names, like for consumer or stream NRG groups etc, the maps would grow and not release memory.
In the benchmark on my machine, this added ~300ns per call, but I think that is ok for now vs the memory usage.

Signed-off-by: Derek Collison <derek@nats.io>
2023-07-20 15:11:28 -07:00
Derek Collison
9280a552b8 Don't error to server logs if message deleted
Signed-off-by: Derek Collison <derek@nats.io>
2023-07-20 14:07:35 -07:00
Derek Collison
6c9fb6a938 [FIXED] Server reload with highly active accounts with service imports could cause panic or dataloss (#4327)
When service imports were reloaded on active accounts with lots of
traffic the server could panic or lose data.

Signed-off-by: Derek Collison <derek@nats.io>
2023-07-20 13:19:17 -07:00
Derek Collison
7477ce8257 When service imports were reloaded on active accounts with lots of traffic the server could panic or lose data.
Signed-off-by: Derek Collison <derek@nats.io>
2023-07-20 12:20:50 -07:00
Derek Collison
8e49fcc6df Undo branch build restrictions, quote go version
Signed-off-by: Derek Collison <derek@nats.io>
2023-07-20 11:17:19 -07:00
Derek Collison
0347f272c8 Don't require TLS for in-process connection (#4323)
This should fix a bug where in-process connections expect TLS over the
`net.Pipe` if TLS is configured.

Signed-off-by: Neil Twigg <neil@nats.io>
2023-07-20 11:01:09 -07:00
Neil Twigg
b7d6b7e7a9 Add unit test to prove connection works
Signed-off-by: Neil Twigg <neil@nats.io>
2023-07-20 11:01:32 +01:00
Caleb Lloyd
7993547bee Adjust in-process server info tls_required to tls_available
Signed-off-by: Caleb Lloyd <caleb@synadia.com>
2023-07-20 10:44:03 +01:00
Neil Twigg
ed9fafc796 Don't require TLS for in-process connection
Signed-off-by: Neil Twigg <neil@nats.io>
2023-07-20 10:43:58 +01:00
Derek Collison
80fb29f9e3 Add test case for concurrent expected last subject sequence (#4319)
Resolves: #4320
2023-07-18 12:37:57 -07:00
Derek Collison
244dda809c Fix bug that would race around check for last sequence per subject
Signed-off-by: Derek Collison <derek@nats.io>
2023-07-18 11:29:59 -07:00
Derek Collison
360f807cef Moved to end for merge with other branches, minor changes
Signed-off-by: Derek Collison <derek@nats.io>
2023-07-18 11:29:26 -07:00
Byron Ruth
e7bf1b3132 Add test case for concurrent expected last subject sequence
Signed-off-by: Byron Ruth <byron@nats.io>
2023-07-18 11:10:51 -04:00
Derek Collison
75ad503ddc Limit branch builds to main and dev (#4312) 2023-07-17 10:39:34 -07:00
Byron Ruth
94c1988ed8 Limit branch builds to main and dev
Signed-off-by: Byron Ruth <byron@nats.io>
2023-07-15 07:01:24 -04:00
Waldemar Quevedo
c1750b8a54 De-flake a few tests (#4311)
This should hopefully make a small handful of tests less flakey.

Signed-off-by: Neil Twigg <neil@nats.io>
2023-07-14 09:57:23 -07:00
Neil Twigg
2527e11304 Increase threshold in TestNoRaceJetStreamSlowFilteredInititalPendingAndFirstMsg
Signed-off-by: Neil Twigg <neil@nats.io>
2023-07-14 17:05:26 +01:00
Neil Twigg
6cdb0c7838 Wait for current in TestJetStreamClusterStreamUpdateSyncBug so in-flight state changes aren't lost
Signed-off-by: Neil Twigg <neil@nats.io>
2023-07-14 17:03:21 +01:00
Neil Twigg
abb47c9554 Only send one message in TestJetStreamRedeliverCount to prevent out-of-order redeliveries
Signed-off-by: Neil Twigg <neil@nats.io>
2023-07-14 16:56:01 +01:00
Neil Twigg
144abc0dd9 Make TestJetStreamAccountImportJSAdvisoriesAsService insensitive to event order
Signed-off-by: Neil Twigg <neil@nats.io>
2023-07-14 16:51:51 +01:00
Neil Twigg
b58204cff7 Use checkFor in TestJetStreamMsgHeaders
Signed-off-by: Neil Twigg <neil@nats.io>
2023-07-14 16:44:24 +01:00
Neil Twigg
979b265e26 Tweak timing in TestJetStreamClusterDeleteConsumerWhileServerDown
Signed-off-by: Neil Twigg <neil@nats.io>
2023-07-14 16:44:15 +01:00
Neil
6e0c0bc61d Remap ports in leaf node tests to hopefully reduce flakes (#4309)
Multiple tests were using the same port numbers and it seems that the
NATS Servers were not always shutting down quickly enough or the test is
reusing a port that was already assigned ephemerally, resulting in
`listen tcp 127.0.0.1:50554: bind: address already in use` failures.

Signed-off-by: Neil Twigg <neil@nats.io>
2023-07-14 15:36:16 +01:00
Neil Twigg
81dd129043 Move assigned ports out of ephemeral range
Signed-off-by: Neil Twigg <neil@nats.io>
2023-07-14 15:08:17 +01:00
Neil Twigg
586717a3c0 Remap ports in leaf node tests to hopefully reduce flakes
Multiple tests were using the same port numbers and it seems that the
NATS Servers were not always shutting down quickly enough, resulting
in `listen tcp 127.0.0.1:50554: bind: address already in use` failures.

Signed-off-by: Neil Twigg <neil@nats.io>
2023-07-14 13:49:15 +01:00
Neil
71db34baf7 Bump v2.9.21-beta (#4306) 2023-07-14 13:48:59 +01:00
Byron Ruth
63864490a5 Bump v2.9.21-beta
Signed-off-by: Byron Ruth <byron@nats.io>
2023-07-13 16:04:11 -04:00
Waldemar Quevedo
97dd7cb07a Release v2.9.20 (#4305) 2023-07-13 13:00:38 -07:00
Byron Ruth
b055f675ba Release v2.9.20 2023-07-13 15:29:30 -04:00
Derek Collison
ff10e7befe Bump to Go 1.19.11 (#4304) 2023-07-13 11:03:11 -07:00
Byron Ruth
4e6a09400a Bump to Go 1.19.11
Signed-off-by: Byron Ruth <byron@nats.io>
2023-07-13 14:00:38 -04:00
Derek Collison
77189b09c7 [FIXED] JetStream republished messages not being received by MQTT QoS0 subscribers (#4303)
Only discard messages from MQTT QoS0 from internal JetStream clients if
really a QoS1 JetStream publish, not just a JetStream client.

Signed-off-by: Derek Collison <derek@nats.io>

Resolves #4291
2023-07-13 07:26:26 -07:00