Commit Graph

4430 Commits

Author SHA1 Message Date
Ivan Kozlovic
79ca0c1787 Move test to "norace_test.go"
The test TestJetStreamClusterConsumerListPaging was in the
jetstream_cluster_3_test.go and because of `-race` flag would
take more than 440 seconds (7+ minutes) as seen here:

https://app.travis-ci.com/github/nats-io/nats-server/jobs/593984385#L335

Without the `-race` flag, this test takes ~17 seconds.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2023-01-23 17:05:18 -07:00
Derek Collison
68b4570226 Fix for filtered state for all subjects when the first sequence(s) are deleted.
Discovered doing the optimizations for interior deletes.

Signed-off-by: Derek Collison <derek@nats.io>
2023-01-21 16:01:44 -08:00
Derek Collison
2aeb5e2c5a Update snapshots to numCores and maxProcs after maxrocs.Set()
Signed-off-by: Derek Collison <derek@nats.io>
2023-01-20 11:30:43 -08:00
Neil Twigg
1baa1fbda8 Use highwayhash for last stream, consumer and cluster snapshots 2023-01-12 16:16:14 +00:00
peaaceChoi
038037381b Fix some typos in code comment 2023-01-12 10:31:32 +09:00
Byron Ruth
f3c0890a97 Bump to 2.9.12-beta
Signed-off-by: Byron Ruth <byron@nats.io>
2023-01-06 12:40:19 -05:00
Byron Ruth
3491f43199 Release v2.9.11
Signed-off-by: Byron Ruth <byron@nats.io>
2023-01-06 12:24:36 -05:00
Neil Twigg
d853b0eb89 Deduplicate *subscription in Sublist 2023-01-06 13:19:20 +00:00
Derek Collison
f5d939ec24 Added test for #3636
Signed-off-by: Derek Collison <derek@nats.io>
2023-01-05 10:56:52 -08:00
Derek Collison
9a69172236 Bump to 2.9.11-RC.1
Signed-off-by: Derek Collison <derek@nats.io>
2023-01-05 10:33:47 -08:00
Derek Collison
ad53d455f8 When migrating leaders off a server when the leafnode is not connected, also ensure leaders can not return until reconnected.
Signed-off-by: Derek Collison <derek@nats.io>
2023-01-05 08:02:50 -08:00
Derek Collison
6c5f0a669d Ensure we add in new consumers from a meta snapshot from the leader.
Signed-off-by: Derek Collison <derek@nats.io>
2023-01-04 22:18:31 -08:00
Derek Collison
d9cb1e6286 Fix for #3734
When a msg blk was not writen correctly, but the idx file was, max bytes for a stream would no longer be honored since the deletion of any messages in that empty block were not being handled properly.

Signed-off-by: Derek Collison <derek@nats.io>
2022-12-31 18:50:46 -08:00
Neil
1d53b47b33 Merge pull request #3754 from nats-io/neil/golangcilint
Switch to `golangci-lint`
2022-12-30 20:12:03 +00:00
Neil Twigg
14d0ba1c65 Fix some lint errors after move to golangci-lint 2022-12-30 20:00:08 +00:00
Derek Collison
713f632fa7 If a stream's meta was not properly written but the file existed, we could re-add the stream but a subsequent restart would lose the stream again.
Also added in healthz for single server systems to make sure all stream directories resulted in recovered streams.

Signed-off-by: Derek Collison <derek@nats.io>
2022-12-29 20:08:56 -08:00
Waldemar Quevedo
861f98128a Remove individual import subs from leafnodes
When a leafnode connection is bound to an account where there was already
a wildcard response import subscription to handle the requests (e.g. `_R_.foo.>`),
this would have created message duplicates due to an extra subscription
being created that also matched the wildcard (e.g. `_R_.foo.bar`).

To avoid this condition, we now skip creating the latter extra subscription
for leafnode connections.

Signed-off-by: Waldemar Quevedo <wally@nats.io>
2022-12-29 15:30:17 -08:00
Byron Ruth
1477b675ff Add back existing HealthzOptions.JSEnabled field
This fixes a backwards incompat change for library usage as well as
using the healthz NATS API which depends on the JSON payload.

Signed-off-by: Byron Ruth <byron@nats.io>
2022-12-26 08:45:22 -05:00
Byron Ruth
f6b8d9f422 Bump version to 2.9.11-beta
Signed-off-by: Byron Ruth <b@devel.io>
2022-12-20 10:56:55 -05:00
Byron Ruth
b6a19e5199 Prepare for v2.9.10 release
Signed-off-by: Byron Ruth <b@devel.io>
2022-12-20 10:33:43 -05:00
Derek Collison
c2285ab166 Merge pull request #3715 from nats-io/two-stream-same-sub
fix and test for overlapping stream subscription on update
2022-12-16 13:27:25 -08:00
Todd Beets
c463b398db Validate no overlapping stream subscriptions on update config (non-clustered jetstream) 2022-12-16 12:58:59 -08:00
Derek Collison
51341c6367 Bump to v2.9.10-beta.1
Signed-off-by: Derek Collison <derek@nats.io>
2022-12-15 10:09:13 -08:00
Derek Collison
a85318bc76 Under the right circumstances Compact could leave a danling last msg block leading to error opening msg block file [""]: open : no such file or directory
When the compaction would not uplevel to a normal purge, but after completion all msg blocks were empty the mb.lmb was not cleared or reset properly.

Signed-off-by: Derek Collison <derek@nats.io>
2022-12-15 06:59:54 -08:00
Derek Collison
786298469c Simplify locking for consumer info requests.
Signed-off-by: Derek Collison <derek@nats.io>
2022-12-14 18:52:15 -08:00
Todd Beets
47c87eb71c fix and test for clustered mem store asset no-quorum if leader restarted 2022-12-14 16:16:08 -08:00
Derek Collison
6ff03574fb Merge pull request #3710 from nats-io/sparse-latency-cp
Improve performance and latency with large number of sparse consumers.
2022-12-14 12:12:03 -08:00
Derek Collison
1a55eb5a7a Fix for condition after restart where first seq was wrong and reported zero timestamp and expiration stopped working.
Signed-off-by: Derek Collison <derek@nats.io>
2022-12-14 07:19:05 -08:00
Derek Collison
5f9a69e4f9 Make sure js is non-nil.
Signed-off-by: Derek Collison <derek@nats.io>
2022-12-13 16:37:00 -08:00
Derek Collison
c90fe9a2fa Improve performance and latency with large number of sparse consumers.
When a stream had a large number of consumers on a server that were sparse, the signaling mechanism would do a linear scan to signal matching consumers. As usage patterns have continued to have more consumers that are filteres and sparse, meaning a message is destined for a single or small number of consumers.

This change moves selection to a sublist that tracks only active consumer leaders for selection, which optimizes selection of consumers to signal when the number of consumers is large.

Signed-off-by: Derek Collison <derek@nats.io>
2022-12-13 15:25:55 -08:00
Derek Collison
dbc81b9c8b Merge pull request #3700 from mprimi/tests_temp_dir_cleanup
Temporary test files cleanup
2022-12-13 12:27:26 -08:00
Derek Collison
c2188a40ac Merge pull request #3709 from nats-io/zero-bug
Fix for regression in which peer re-assign to a former RG would zero state
2022-12-13 10:03:56 -08:00
Todd Beets
c0ca398b83 use jsz instead of struct direct in final state test 2022-12-12 20:00:14 -08:00
Marco Primi
f8a030bc4a Use testing.TempDir() where possible
Refactor tests to use go built-in temporary directory utility for tests.

Also avoid binding to default port (which may be in use)
2022-12-12 13:18:44 -08:00
Derek Collison
17484bd701 Fix test
Signed-off-by: Derek Collison <derek@nats.io>
2022-12-12 13:12:36 -05:00
Derek Collison
fa67c50bec Make sure we clear the old raft node from our stream assignment.
This would not allow a re-assignment of a peer to work correctly.

Signed-off-by: Derek Collison <derek@nats.io>
2022-12-12 12:51:08 -05:00
Todd Beets
ad69e1c535 test for tainted remove peer 2022-12-10 11:50:08 -08:00
Byron Ruth
566d1adfa7 Fix /healthz?js-enabled=true behavior
When js-enabled is set to true, the condition was only checked if
the `getJetStream()` call returned `nil`. However, if it non-nil,
all remaining checks were executed, including assessing the health
of the assets (streams and consumers).

This change addresses two issues:

- Switch to use `js.isEnabled()` which will check whether the value
  is nil OR `js.disabled = true` which can occur if the subsystem
  is temporarily disabled (insufficient resources).
- Correctly exit the check after the assertion and before meta and
  asset checks are performed.

In addition, the option has been renamed to `js-enabled-only` to align
with the `js-server-only` naming. The previous `js-enabled` name still
works, but is mapped to this new option. A warning is emitted noting
the previous option is deprecated.

Fix #3703

Signed-off-by: Byron Ruth <b@devel.io>
2022-12-10 07:34:32 -05:00
Byron Ruth
4352a17080 Bump version to 2.9.10-dev
Signed-off-by: Byron Ruth <b@devel.io>
2022-12-08 12:47:42 -05:00
Byron Ruth
d8b9688567 Prepare for next release
Signed-off-by: Byron Ruth <b@devel.io>
2022-12-08 12:22:38 -05:00
Derek Collison
8c6418ee45 Extensive test in support of issue #3191.
Signed-off-by: Derek Collison <derek@nats.io>
2022-12-07 12:36:29 -08:00
Sandy Kellagher
7907950a54 Fix for #3682: do not delay PINGs for GATEWAY or solicited LEAF connections, to ensure failover of leaf node connections 2022-12-07 16:19:33 +00:00
Derek Collison
5baf90265c Bump to v2.9.9-RC.1
Signed-off-by: Derek Collison <derek@nats.io>
2022-12-07 05:18:02 -08:00
Derek Collison
da2059a5f0 Merge pull request #3678 from nats-io/ut-replacepeer
tag policies not honored in reassignment after peer remove
2022-12-06 17:50:11 -08:00
Derek Collison
2f27438230 Make stream removal from a server consistent.
Signed-off-by: Derek Collison <derek@nats.io>
2022-12-06 17:11:43 -08:00
Derek Collison
0a65d7960b Merge pull request #3690 from nats-io/upstream-jwt-acc-reenable
Fix to reenable JetStream for account when reenabled (dev → main)
2022-12-06 16:09:40 -08:00
Derek Collison
29b614a057 Fix flapping test
Signed-off-by: Derek Collison <derek@nats.io>
2022-12-06 16:08:45 -08:00
Waldemar Quevedo
6df92f40dc Fix to reenable JetStream for account when reenabled
Signed-off-by: Waldemar Quevedo <wally@nats.io>
2022-12-06 15:53:03 -08:00
Derek Collison
549b77ca2d Ensure that ephemeral consumers that are deleted on startup properly are removed from the system.
Signed-off-by: Derek Collison <derek@nats.io>
2022-12-06 15:07:46 -08:00
Derek Collison
894115b82b Fix for server panic when consumer state was not decoded correctly.
The bug was when a timestamp for the pending state was exactly -1 which could happen based on timing of the redlivered pending items which would set pending.Timestamp into the future potentially and the timing on the encodeConsumerState call.

Minor fixes to raft.

Signed-off-by: Derek Collison <derek@nats.io>
2022-12-06 14:16:20 -08:00