Commit Graph

5984 Commits

Author SHA1 Message Date
Ivan Kozlovic
00a38dc98e Merge pull request #3263 from nats-io/update_deps
[UPDATED] Compression library
2022-07-14 10:57:55 -06:00
Ivan Kozlovic
dac8b0959b [UPDATED] Compression library
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-07-14 10:33:38 -06:00
Matthias Hanel
95caa6ba36 bump version to 2.9.0-beta.7 (#3259)
Signed-off-by: Matthias Hanel <mh@synadia.com>
2022-07-12 22:41:52 +02:00
Matthias Hanel
023500e1da add the ability to cancel a move in progress (#3253)
* add the ability to cancel a move in progress

Move to individual subjects for move and cancel_move

New subjects are:
$JS.API.ACCOUNT.STREAM.MOVE.*.*
$JS.API.ACCOUNT.STREAM.CANCEL_MOVE.*.*

last and second to last token are account and stream name

Signed-off-by: Matthias Hanel <mh@synadia.com>
2022-07-12 21:54:18 +02:00
Matthias Hanel
d53d2d0484 [Added] account specific monitoring endpoint(s) (#3250)
Added http monitoring endpoint /accstatz
It responds with a list of statz for all accounts with local connections
the argument "unused=1" can be provided to get statz for all accounts
This endpoint is also exposed as nats request under:

This monitoring endpoint is exposed via the system account.
$SYS.REQ.ACCOUNT.*.STATZ
Each server will respond with connection statistics for the requested
account. The format of the data section is a list (size 1) identical to the event
$SYS.ACCOUNT.%s.SERVER.CONNS which is sent periodically as well as on
connect/disconnect. Unless requested by options, server without the account,
or server where the account has no local connections, will not respond.

A PING endpoint exists as well. The response format is identical to
$SYS.REQ.ACCOUNT.*.STATZ
(however the data section will contain more than one account, if they exist)
In addition to general filter options the request takes a list of accounts and
an argument to include accounts without local connections (disabled by default)
$SYS.REQ.ACCOUNT.PING.STATZ

Each account has a new system account import where the local subject
$SYS.REQ.ACCOUNT.PING.STATZ essentially responds as if
the importing account name was used for $SYS.REQ.ACCOUNT.*.STATZ

The only difference between requesting ACCOUNT.PING.STATZ from within
the system account and an account is that the later can only retrieve
statz for the account the client requests from.

Also exposed the monitoring /healthz via the system account under
$SYS.REQ.SERVER.*.HEALTHZ
$SYS.REQ.SERVER.PING.HEALTHZ
No dedicated options are available for these.
HEALTHZ also accept general filter options.

Signed-off-by: Matthias Hanel <mh@synadia.com>
2022-07-12 21:50:32 +02:00
Ivan Kozlovic
520d323ea5 Merge pull request #3258 from nats-io/js_detect_as_orphans
[FIXED] JetStream: servers may be reported as orphaned
2022-07-12 10:26:38 -06:00
Ivan Kozlovic
39a0cfccca [FIXED] JetStream: servers may be reported as orphaned
In some situations, a server may report that a remote server is
detected as orphaned (and the node is marked as offline). This is
because the orphaned detection relies on conns update to be received,
however, servers would suppress the update if an account does not
have any connections attached.

This PR ensures that the update is sent regardless if the account
is JS configured (not necessarily enabled at the moment).

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-07-11 16:15:01 -06:00
Jean-Noël Moyne
23a9036b9b Improves error handling for subject mapping destination mustache functions (#3255) 2022-07-11 14:56:34 -07:00
Matthias Hanel
988629a1ed enhanced unit test to check for leader post move (#3257)
Signed-off-by: Matthias Hanel <mh@synadia.com>
2022-07-11 20:35:04 +02:00
Ivan Kozlovic
f241a92963 Merge pull request #3256 from nats-io/fix_test_causing_flappers
Fixed a test that was causing others to flap
2022-07-11 10:26:50 -06:00
Ivan Kozlovic
50c561a040 Fixed a test that was causing others to flap
The test was lowering the eventsHBInterval to low value but not
restoring its original value. This would cause some servers to
be considered "orphan" and the shutdown event sent causing their
raft node to be considered "offline", which then would result
in some tests failing with "insufficient resources".

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-07-11 10:00:03 -06:00
Derek Collison
da305f2044 Merge pull request #3252 from nats-io/stream_direct_update
Allow stream and mirror direct get to be updated
2022-07-08 07:54:33 -07:00
Derek Collison
7ff534d1da Allow get next for json stream get version
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-08 07:19:15 -07:00
Derek Collison
59a0a3ba5c Allow stream and mirror direct get abilities to be updated.
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-08 07:13:34 -07:00
Derek Collison
61fe6bcffb Bump to 2.9.0-beta.5
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-07 17:54:46 -07:00
Derek Collison
85123861d4 Merge pull request #3249 from nats-io/catchup_eof
Fix for stalled catchup in endless cycle on EOF
2022-07-07 17:54:07 -07:00
Matthias Hanel
9c55e67a35 Merge pull request #3248 from nats-io/fix-uniqe-tag-stream-update
Fix unique_tag issue with stream replica increase
2022-07-08 02:23:59 +02:00
Derek Collison
333e2fc2f1 Fix for stalled catchup in endless cycle on EOF trying to retrieve catchup msg.
A customer experienced and endless failure to have a stream cacthup. The current leader was being asked for a message from a snapshot that was larger then what we had, resulting in EOF which silently failed.
We now detect this and signal end of catchup and redo the bad snapshot if possible.

Signed-off-by: Derek Collison <derek@nats.io>
2022-07-07 13:42:41 -07:00
Matthias Hanel
f0ee56cf0a Fix unique_tag issue with stream replica increase
When increasing the replica count unique tags for already existing peers
where ignored, which could lead to bad placement

Signed-off-by: Matthias Hanel <mh@synadia.com>
2022-07-07 21:22:55 +02:00
Ivan Kozlovic
7ab256185e Merge pull request #3038 from nats-io/js_expected_last_seq_zero
[CHANGED] JetStream: accept "Nats-Expected-Last-Sequence" with "0"
2022-07-07 10:36:52 -06:00
Derek Collison
c49d081341 Fix data race
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-07 09:05:50 -07:00
Derek Collison
be789c620d Bump to 2.9.0-beta.4
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-07 08:46:18 -07:00
Ivan Kozlovic
be8734e32b [CHANGED] JetStream: accept "Nats-Expected-Last-Sequence" with "0"
We use to ignore if the seq was 0, but now would treat it as
a requirement that the stream be empty if header is present but
set to 0.

This relates to client PR: https://github.com/nats-io/nats.go/pull/958

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-07-07 09:44:27 -06:00
Derek Collison
b4aaec3417 Also wait on consumer
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-06 21:00:15 -07:00
Derek Collison
05e8d82c50 Allow retries on connect
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-06 20:54:13 -07:00
Derek Collison
69f522cb9f Make sure to clean up client connection
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-06 19:29:32 -07:00
Matthias Hanel
a831185a47 Merge pull request #3234 from nats-io/stream-move-fix-first-commit-only
fixes peer removal, simplifies move, more tests
2022-07-07 03:54:10 +02:00
Matthias Hanel
509eec4baa bump server version to 2.9.0-beta.3
Signed-off-by: Matthias Hanel <mh@synadia.com>
2022-07-07 03:36:19 +02:00
Derek Collison
16f788adce Consumer isFiltered could crash if the stream was a mirror with no direct subjects but it was in interest or workqueue retention mode.
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-07 03:35:41 +02:00
Matthias Hanel
70be4b77f9 fixes peer removal, simplifies move, more tests
Make sure when processing a peer removal that the stream assignment agrees.
When a new leader takes over it can resend a peer removal, and if the stream/consumer really was rescheduled we could remove by accident.

Also need to make sure that when we remove a stream we remove the node as part of the stream assignment.
If we didn't, if the same asset returned to this server we would not start up the monitoring loop.

Simplify migration logic in monitorStream, to be driven by leader only

Improved unit tests

Added failure when server not in peer list

Move command does not require server anymore

Signed-off-by: Matthias Hanel <mh@synadia.com>
2022-07-07 03:32:13 +02:00
Derek Collison
de3a90cbc8 Merge pull request #3247 from nats-io/get_direct_next
Allows direct get to also do get next for subject with starting sequence
2022-07-06 16:46:46 -07:00
Derek Collison
f8939b40bc Do not unsubscribe from direct access on leader stepdown, only stopping.
Also wait for stream to have replicas and leader for test.

Signed-off-by: Derek Collison <derek@nats.io>
2022-07-06 16:20:12 -07:00
Derek Collison
1ea608eabf Allows direct get to also do get next for subject with starting sequence
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-06 14:22:28 -07:00
Derek Collison
94c526f54c Merge pull request #3246 from nats-io/sys_group
Reserve a system queue group
2022-07-06 13:29:08 -07:00
Derek Collison
5690059dac Reserve a system queue group
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-06 13:16:13 -07:00
Ivan Kozlovic
697811cd9b Merge pull request #3242 from nats-io/fix_3239
[ADDED] Symlink for deb/rpm packages
2022-07-06 12:04:50 -06:00
Derek Collison
90caf12d96 Attempt to fix flapping test
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-06 09:11:31 -07:00
Derek Collison
722ae548dd Fix data race
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-06 09:11:22 -07:00
Derek Collison
0c9ed8c10a Bump to 2.9.0-beta.2
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-05 14:01:28 -07:00
Derek Collison
8b7f7effbd Merge pull request #3243 from nats-io/issue_3178
Direct access to JetStream resources when a leafnode connection is down.
2022-07-05 13:58:08 -07:00
Derek Collison
c14fda51e7 Direct access to JetStream resources would be affected if across a leafnode that was down.
This allows a solciting leafnode config to ask that any JetStream cluster assets that are a current leader have the leader stepdown.

Signed-off-by: Derek Collison <derek@nats.io>
2022-07-05 12:35:09 -07:00
Derek Collison
1cc63c023d Merge pull request #3238 from nats-io/mirror_direct
Direct stream access enhancements
2022-07-05 10:38:48 -07:00
Derek Collison
c395fc3c94 Merge pull request #3237 from nats-io/maxprocs
Allow maxprocs to debug log after start banner
2022-07-05 09:49:30 -07:00
Ivan Kozlovic
04c6d6176a [ADDED] Symlink for deb/rpm packages
Since v2.7.4 and due to an update of the goreleaser tool, the
server is now installed under "/usr/bin" instead of "/usr/local/bin".

We keep the install in "/usr/bin" but this PR adds symlink so that
"/usr/local/bin" still points to the nats-server.

Resolves #3239

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-07-05 10:05:04 -06:00
Derek Collison
ea6e258491 Merge pull request #3241 from nats-io/fifo_pull
Make pull consumers FIFO per message, not per request.
2022-07-05 07:02:22 -07:00
Derek Collison
52baa95e2a When stalled for MaxAckPending, expire all pull requests that are one shot, meaning had at least 1 delivered message
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-04 19:14:49 -07:00
Derek Collison
1b580c67f3 Make pull consumers FIFO per message, not per request.
This effectively means that requests with batch > 1 will process a message and go to the end of the line.

Signed-off-by: Derek Collison <derek@nats.io>
2022-07-04 13:05:57 -07:00
Derek Collison
81a9906ad9 Wait a bit longer for the direct sub
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-03 12:54:15 -07:00
Derek Collison
9b7c81c37e Some tests improvements on non-standard JS cluster setup
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-03 12:45:27 -07:00
Derek Collison
47bef915ed Allow all members of a replicated stream to participate in direct access.
We will wait until a non-leader replica is current to subscribe.

Signed-off-by: Derek Collison <derek@nats.io>
2022-07-03 11:08:24 -07:00