Commit Graph

4405 Commits

Author SHA1 Message Date
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
Todd Beets
bfd7d7f9ba improved test to remove false positive result 2022-12-06 12:48:53 -08:00
Todd Beets
3fdfb8a12f Merge branch 'main' into ut-replacepeer
# Conflicts:
#	server/jetstream_cluster_3_test.go
2022-12-06 10:51:22 -08:00
Byron Ruth
d55ec395a3 Update --signal usage help
This includes `ldm` and `term`.

Signed-off-by: Byron Ruth <b@devel.io>
2022-12-06 06:45:00 -05:00
Derek Collison
65a833ccd9 Merge pull request #3680 from ripienaar/snapshot_full_state
Do not gather full state for snapshots
2022-12-06 03:31:17 -08:00
Derek Collison
74c373233f Update to test
Signed-off-by: Derek Collison <derek@nats.io>
2022-12-05 17:32:52 -08:00
R.I.Pienaar
9bbc01384e Do not gather full state for snapshots
This avoids hust state outputs for streams with many
deleted items

Signed-off-by: R.I.Pienaar <rip@devco.net>
2022-12-05 22:05:12 +01:00
Todd Beets
ef27d4d534 tag policies not honored in reassignment after peer remove 2022-12-04 20:39:11 -08:00
Derek Collison
5f7c8e21a2 Fixed issues with multiple concurrent stream create requests.
First issue was applications not getting any response.
However, there was also a more serious issue that would create multiple raft groups for each concurrent request.
The servers would only run one stream monitor loop, however they would update the state to the new raft group's name, so on server restart the stream would be using a different raft group then existing servers.

Signed-off-by: Derek Collison <derek@nats.io>
2022-12-04 19:13:51 -08:00
Marco Primi
f20101370c Adjust minimum operations for JetStream benchmarks
Lower minimum amount of data / number of operations so that benchmarks 
can run in reasonable time.

Minimum amount of work should be controlled via `-benchtime` flag. But 
due to these hardcoded limits, some tests were taking too long.

e.g. Running for 2 minutes even with `-benchtime` set to 1 second.
2022-12-02 15:29:34 -08:00
Derek Collison
a5814dad1f In operator mode do not set a no_auth_user for $G.
Signed-off-by: Derek Collison <derek@nats.io>
2022-11-25 10:20:35 -08:00
Derek Collison
6f616c57ca Bump to v2.9.9-beta as per release process
Signed-off-by: Derek Collison <derek@nats.io>
2022-11-22 13:00:03 -08:00
Derek Collison
03a5f20080 Release v2.9.8
Signed-off-by: Derek Collison <derek@nats.io>
2022-11-22 12:29:31 -08:00
Derek Collison
06bab2c4de If no_auth_user is set, clear auth required for server info.
Signed-off-by: Derek Collison <derek@nats.io>
2022-11-21 20:26:54 -08:00
Derek Collison
5e8c1993cb Server might crash if a pull consumer with inactivity threshold acks a msg then immediately deletes the consumer.
Signed-off-by: Derek Collison <derek@nats.io>
2022-11-21 15:22:23 -08:00
Ivan Kozlovic
dde34cea54 Bump to v2.9.8-beta as per release process
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-11-17 10:14:37 -07:00
Ivan Kozlovic
4765ea616f Release v2.9.7
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-11-17 09:45:08 -07:00
Derek Collison
fe57c687f6 Make sure header keys do not have additional prefixes.
Signed-off-by: Derek Collison <derek@nats.io>
2022-11-17 06:52:26 -08:00
Raymond
4d8964e57b Added stream created timestamp to stream detail 2022-11-17 13:59:58 +01:00
Ivan Kozlovic
deb9d252a3 Bump version to 2.9.7-RC2
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-11-16 17:23:15 -07:00
Ivan Kozlovic
74a16b0097 Merge pull request #3640 from nats-io/fix_3639
[FIXED] JetStream: WorkQueue not preventing overlapping consumers
2022-11-16 17:22:35 -07:00
Ivan Kozlovic
49faba9e33 [FIXED] JetStream: WorkQueue not preventing overlapping consumers
A stream with a WorkQueue retention policy is supposed to allow
more than one consumer if they user filtered subjects, but those
subjects should not overlap.

There was an issue that if a new consumer had a filter subject
"wider" than an existing one, the error was not detected and
the new consumer was incorrectly accepted.

Resolves #3639

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-11-16 17:09:30 -07:00
Derek Collison
e4b5b7ec64 Make mirror consumers use filtered version of consumer create like source consumers.
Signed-off-by: Derek Collison <derek@nats.io>
2022-11-16 15:12:14 -08:00
Derek Collison
6cb7f68ef7 Updates based on feedback w/ Ivan
Signed-off-by: Derek Collison <derek@nats.io>
2022-11-16 11:53:46 -08:00
Derek Collison
aa57adbcd0 Use default here
Signed-off-by: Derek Collison <derek@nats.io>
2022-11-16 11:31:49 -08:00
Derek Collison
f696c6559e Adjust test for jitter on ephemerals.
Signed-off-by: Derek Collison <derek@nats.io>
2022-11-15 17:51:01 -08:00