Commit Graph

6352 Commits

Author SHA1 Message Date
Ivan Kozlovic
f88f2265d2 [UPDATED] Dependencies
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-09-22 14:13:40 -06:00
Ivan Kozlovic
e5d3b6b0de Merge pull request #3489 from nats-io/ln_ws_no_auth
[FIXED] LeafNode: connecting using websocket and no_auth_user
2022-09-22 10:57:20 -06:00
Ivan Kozlovic
cfd4f7d5b3 [FIXED] LeafNode: connecting using websocket and no_auth_user
If the `no_auth_user` is set in the `websocket{}` block and a
server creates a leafnode connection using the websocket port,
and does not provide credentials, that no_auth_user should be
used, but was not.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-09-22 10:35:36 -06:00
Derek Collison
ac88662a89 Bump to 2.9.1-Beta.2
Signed-off-by: Derek Collison <derek@nats.io>
2022-09-22 08:27:50 -07:00
Derek Collison
c65ef5c1b3 Merge pull request #3487 from nats-io/discard-new-per
Allow discard new per subject for certain KV type scenarios.
2022-09-22 08:26:10 -07:00
Derek Collison
ae1e2f6cc7 Merge pull request #3486 from nats-io/issue_3484
[FIXED] Filtered Consumers return wrong messages.
2022-09-22 07:55:22 -07:00
Derek Collison
9774ad5641 Added check on publish error.
Signed-off-by: Derek Collison <derek@nats.io>
2022-09-22 07:13:57 -07:00
Derek Collison
61a3cff274 Also require MaxMsgsPerSubject to be set per peer review feedback.
Signed-off-by: Derek Collison <derek@nats.io>
2022-09-22 06:56:32 -07:00
Derek Collison
2d737edba6 Allow discard new per subject for certain KV type scenarios. Requires general DiscardNewPolicy.
Signed-off-by: Derek Collison <derek@nats.io>
2022-09-22 06:38:29 -07:00
Derek Collison
7e1bc54389 Fix for #3848.
When a block's subject meta state was swapped out and subsequently loaded back in with only one subject present, but other messages with different subjects were added later, a filtered get could return the wrong result.

Signed-off-by: Derek Collison <derek@nats.io>
2022-09-22 04:57:05 -07:00
Ivan Kozlovic
52d7b481c4 Bump version to 2.9.1-beta.1
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-09-20 09:22:20 -06:00
Derek Collison
f0c0d14f6d Merge pull request #3478 from nats-io/filtered-sources
When filtering a source stream use new consumer create API subject.
2022-09-16 14:59:53 -07:00
Derek Collison
8b2315eadd When filtering a source stream use new consumer create API subject.
Signed-off-by: Derek Collison <derek@nats.io>
2022-09-16 14:45:33 -07:00
Ivan Kozlovic
28e5aeb570 Merge pull request #3476 from nats-io/js_add_leader_id_in_meta_cluster_info
[ADDED] JetStream: peer (the hash of server name) in statsz/jsz
2022-09-16 15:42:26 -06:00
Ivan Kozlovic
170ff49837 [ADDED] JetStream: peer (the hash of server name) in statsz/jsz
A request to `$SYS.REQ.SERVER.PING.JSZ` would now return something
like this:
```
...
    "meta_cluster": {
      "name": "local",
      "leader": "A",
      "peer": "NUmM6cRx",
      "replicas": [
        {
          "name": "B",
          "current": true,
          "active": 690369000,
          "peer": "b2oh2L6w"
        },
        {
          "name": "Server name unknown at this time (peerID: jZ6RvVRH)",
          "current": false,
          "offline": true,
          "active": 0,
          "peer": "jZ6RvVRH"
        }
      ],
      "cluster_size": 3
    }
```
Note the "peer" field following the "leader" field that contains
the server name. The new field is the node ID, which is a hash of
the server name.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-09-16 15:31:37 -06:00
Ivan Kozlovic
09cdec793d Merge pull request #3474 from nats-io/js_max_bytes_close_req
[FIXED] JetStream: Pull requests closed due to max_bytes were silent
2022-09-16 15:23:25 -06:00
Ivan Kozlovic
ca3028904d Merge pull request #3477 from nats-io/js_fix_panic_on_peer_remove
[FIXED] JetStream: possible panic on peer remove on server shutdown
2022-09-16 15:23:09 -06:00
Ivan Kozlovic
378fed164d [FIXED] JetStream: possible panic on peer remove on server shutdown
This was discovered by new test TestJetStreamClusterRemovePeerByID.
I saw this on Travis and repeating the test locally with -count=10
I was able to reproduce. The issue is cc.meta being nil but accessing
cc.meta.ID() directly.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-09-16 15:06:58 -06:00
Ivan Kozlovic
ff0bda415b [FIXE] JetStream: Pull requests closed due to max_bytes were silent
If the client pull requests has a max_bytes value and the server
cannot deliver a single message (because size is too big), it
is sending a 409 to signal that to the client library. However,
if it sends at least a message then it would close the request
without notifying the client with a 409, which would cause the
client library to have to wait for its expiration/timeout.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-09-15 16:55:41 -06:00
Ivan Kozlovic
dc2e4b714a Merge pull request #3473 from nats-io/js_raft_remove_by_peer_id
[ADDED] JetStream: ability to remove a server by peer ID instead of name
2022-09-15 13:52:20 -06:00
Ivan Kozlovic
3fadccab38 Move new test to new jetstream_cluster_3_test.go file
Since the second batch was already past the 5min mark and a bit
longer than the first batch, it is a good opportunity to add
this new test in a new file. Updated runTestsOnTravis and travis.yml
accordingly.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-09-15 12:13:00 -06:00
Ivan Kozlovic
f113163b9f Change ByID boolean to Peer string and add Peer id in replicas output
The CLI will now be able to display the peer IDs in MetaGroupInfo
if it choses to do so, and possibly help user select the peer ID
from a list with a new command to remove by peer ID instead of
by server name.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-09-15 10:39:23 -06:00
Derek Collison
1838ada193 Merge pull request #3472 from nats-io/need-ack-opt
Optimize needAck.
2022-09-15 05:49:23 -07:00
Ivan Kozlovic
e1f0361b98 [ADDED] JetStream: ability to remove a server by peer ID instead of name
This can be helpful after a partial cluster restart since in that
case the server name may not be known. However "server report jetstream"
would report the peer ID that then can be used.

For instance here is the output after a cluster restart where server "C"
is not restarted.

```
nats -s nats://sys:pwd@localhost:4222 server report jetstream
...
╭────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                  RAFT Meta Group Information                                   │
├─────────────────────────────────────────────────────┬────────┬─────────┬────────┬────────┬─────┤
│ Name                                                │ Leader │ Current │ Online │ Active │ Lag │
├─────────────────────────────────────────────────────┼────────┼─────────┼────────┼────────┼─────┤
│ A                                                   │ yes    │ true    │ true   │ 0.00s  │ 0   │
│ B                                                   │        │ true    │ true   │ 0.53s  │ 0   │
│ Server name unknown at this time (peerID: jZ6RvVRH) │        │ false   │ false  │ 0.00s  │ 0   │
╰─────────────────────────────────────────────────────┴────────┴─────────┴────────┴────────┴─────╯
```

With a change to the NATS CLI we could have something like:
```
nats -s nats://sys:pwd@localhost:4222 server raft peer-remove jZ6RvVRH --by_id
```

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-09-14 18:10:26 -06:00
Derek Collison
2aaf22b0de For ackMsg, make sure sequence is still relevant as well.
Signed-off-by: Derek Collison <derek@nats.io>
2022-09-14 16:47:35 -07:00
Derek Collison
6c97733bb8 Optimize needAck.
Signed-off-by: Derek Collison <derek@nats.io>
2022-09-14 16:25:50 -07:00
Ivan Kozlovic
c8ea439e21 Merge pull request #3471 from nats-io/jarema/durable-and-name-mismatch
Add error if Consumer Name and Durable are not equal
2022-09-14 13:26:19 -06:00
Tomasz Pietrek
dbf7636e15 Add error if Consumer Durable and Name are not equal
This error will happen only if both Name and Durable are specified.

Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
2022-09-14 20:31:18 +02:00
Derek Collison
d4f313027c Merge pull request #3470 from goku321/random-consumer-peer
Fix peer randomisation when creating consumers groups for replica=1
2022-09-14 07:53:26 -07:00
Deepak
e9ce118c56 Fix peer randomisation when creating consumers groups for replica=1
Signed-off-by: Deepak <sah.sslpu@gmail.com>
2022-09-14 13:58:49 +05:30
Ivan Kozlovic
a41af2bdcb Merge pull request #3463 from nats-io/jnm/fix_mapping_split
[FIXED] Edge condition handling in {{Split()}} subject mapping function
2022-09-09 14:39:19 -06:00
Ivan Kozlovic
6e729f13bf Merge pull request #3464 from nats-io/split_tests
Split more tests to speed up Travis run
2022-09-09 14:22:09 -06:00
jnmoyne
a1f90b8776 Fixes mishandling of an edge condition in the {{Split()}} subject mapping function 2022-09-09 12:42:03 -07:00
Ivan Kozlovic
29224c8ea9 Split more tests to speed up Travis run
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-09-09 12:45:48 -06:00
Ivan Kozlovic
925f57ccc2 Bump version to 2.9.1-beta
As per the release process, bumping the version to next update
with beta suffix once the release is out.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-09-09 10:17:26 -06:00
Ivan Kozlovic
517d9b382d Merge pull request #3460 from nats-io/release_2_9_0
Release v2.9.0
2022-09-09 08:45:32 -06:00
Ivan Kozlovic
b979556556 Release v2.9.0
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-09-09 08:23:48 -06:00
Matthias Hanel
f7cb5b1f0d changed format of JSClusterNoPeers error (#3459)
* changed format of JSClusterNoPeers error

This error was introduced in #3342 and reveals to much information
This change gets rid of cluster names and peer counts.

All other counts where changed to booleans,
which are only included in the output when the filter was hit.

In addition, the set of not matching tags is included.
Furthermore, the static error description in server/errors.json 
is moved into selectPeerError

sample errors:
1) no suitable peers for placement, tags not matched ['cloud:GCP', 'country:US']"
2) no suitable peers for placement, insufficient storage

Signed-off-by: Matthias Hanel <mh@synadia.com>
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
Co-authored-by: Ivan Kozlovic <ivan@synadia.com>
2022-09-08 18:25:48 -07:00
Ivan Kozlovic
50d62cede3 Merge pull request #3458 from nats-io/add_s390x_arch
[ADDED] Architecture s390x in goreleaser.yml file
2022-09-08 16:57:24 -06:00
Ivan Kozlovic
d4f2b179dd [ADDED] Architecture s390x in goreleaser.yml file
[ci skip]

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-09-08 16:49:59 -06:00
Derek Collison
fdf52554c7 Bump to 2.9.0-RC.19
Signed-off-by: Derek Collison <derek@nats.io>
2022-09-08 12:08:48 -07:00
Derek Collison
d979937bbd Merge pull request #3456 from nats-io/max-bytes-pull
[IMPROVED] Pull request logic
2022-09-08 12:08:10 -07:00
Derek Collison
dedf21d45d Fix for issue #3455
When hitting max ack pending from getNextMsg would remove one shots incorrectly.

Signed-off-by: Derek Collison <derek@nats.io>
2022-09-08 11:56:57 -07:00
Derek Collison
b32814d5fd Better accounting for max-bytes for pull consumers
Signed-off-by: Derek Collison <derek@nats.io>
2022-09-08 11:56:57 -07:00
Ivan Kozlovic
ae0d808f5b Merge pull request #3457 from nats-io/cleanup_tests
Fixed some tests
2022-09-08 12:24:07 -06:00
Ivan Kozlovic
6fba6c8188 Merge pull request #3454 from nats-io/js_stream_info_pagination
Adds pagination to stream info
2022-09-08 12:23:41 -06:00
jnmoyne
95c1946231 Implements pagination for JS Stream Info requests 2022-09-08 10:45:20 -07:00
Ivan Kozlovic
b69ffe244e Fixed some tests
Code change:
- Do not start the processMirrorMsgs and processSourceMsgs go routine
if the server has been detected to be shutdown. This would otherwise
leave some go routine running at the end of some tests.
- Pass the fch and qch to the consumerFileStore's flushLoop otherwise
in some tests this routine could be left running.

Tests changes:
- Added missing defer NATS connection close
- Added missing defer server shutdown

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-09-08 11:28:23 -06:00
Ivan Kozlovic
c008410c43 Merge pull request #3452 from mschneider82/expire-display
server: expire display Never instead of 1970
2022-09-08 08:33:20 -06:00
Matthias Schneider
a58a7bf1ec server: expire display Never instead of 1970 2022-09-08 10:03:04 +02:00