Commit Graph

4246 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
Matthias Schneider
a58a7bf1ec server: expire display Never instead of 1970 2022-09-08 10:03:04 +02:00
Derek Collison
a7744026e1 Bump to 2.9.0-RC.18
Signed-off-by: Derek Collison <derek@nats.io>
2022-09-07 19:35:56 -07:00
Ivan Kozlovic
8c1c6951dc JetStream: R1 durables were incorrectly migrated on shutdown
This could happen for stream with R>1 but with a durable that
has an override of R=1.

Fixed a test to make sure assets have an elected leader.

Also fixed a gateway test that would cause a data race.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-09-07 19:49:16 -06:00
Derek Collison
53453932a8 Need to wait on cluster ready
Signed-off-by: Derek Collison <derek@nats.io>
2022-09-07 16:07:09 -07:00
Derek Collison
c3203a3bb5 Use lostQuorum default versus live for reporting.
Signed-off-by: Derek Collison <derek@nats.io>
2022-09-07 13:56:38 -07:00
Derek Collison
b86e941ce4 tweak lost quorum reporting
Signed-off-by: Derek Collison <derek@nats.io>
2022-09-07 10:57:01 -07:00
Derek Collison
fbf2233e4a Only complain about leaderless group with previous leader if we know jetstream has been running for some threshold.
Signed-off-by: Derek Collison <derek@nats.io>
2022-09-07 08:47:55 -07:00
Derek Collison
a4b6b2041f Bump to 2.9.0-RC.17
Signed-off-by: Derek Collison <derek@nats.io>
2022-09-06 17:02:13 -07:00
Ivan Kozlovic
fbc7c25520 Merge pull request #3435 from nats-io/mon-js-reserved-stats
js: add per account reserved mem/store bytes
2022-09-06 18:01:22 -06:00
Waldemar Quevedo
46d73eddae js: add per account reserved mem/store bytes
Signed-off-by: Waldemar Quevedo <wally@nats.io>
2022-09-06 16:43:10 -07:00
Derek Collison
84b95be56e NoAck allowed now on pull consumers
Signed-off-by: Derek Collison <derek@nats.io>
2022-09-06 15:19:17 -07:00
Derek Collison
e4a6b6bc94 Merge pull request #3441 from nats-io/no-auto-direct-get
Do not auto-promote direct get functionality.
2022-09-06 13:35:46 -07:00
Derek Collison
9c3bd17059 Updates to tests
Signed-off-by: Derek Collison <derek@nats.io>
2022-09-06 13:33:39 -07:00
Derek Collison
b850a95d4c Remove auto-promotion of direct get. Force stream config to set AllowDirect to true.
Signed-off-by: Derek Collison <derek@nats.io>
2022-09-06 13:33:39 -07:00
Ivan Kozlovic
8a71c642c6 Merge pull request #3439 from mprimi/nats-pub-benchmark
NATS Publish benchmark
2022-09-06 11:24:06 -06:00
Marco Primi
e498781921 NATS Publish benchmark 2022-09-06 09:52:45 -07:00
Ivan Kozlovic
16eb2af0ec [FIXED] JetStream: Restarted queue subscriptions may not receive msgs
The server was not properly handling queue subscriptions internal
notifications which could lead to messages not being delivered
to applications using a queue group to consume from a JetStream
consumer after they were restarted.

Resolves #1066

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-09-05 16:38:43 -06:00
Ivan Kozlovic
c4b5ca7cff Merge pull request #3433 from nats-io/js_offline_nodes
[FIXED] JetStream: Some nodes may never be reported as offline
2022-09-01 13:28:29 -06:00
Ivan Kozlovic
88ece75765 [FIXED] JetStream: Some nodes may never be reported as offline
In some rare situations, it is possible that nodes are added
to the cluster but are not properly tracked and not shown as
offline when they exit the cluster.

Relates to #3258

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-09-01 12:48:12 -06:00
Marco Primi
1e040a5569 KeyValue Put/Get/Update benchmark 2022-08-31 17:12:29 -07:00
Derek Collison
4b5e0a3f87 Merge pull request #3429 from nats-io/stream-overlap-subjects
[FIXED] Do not allow overlap between multiple subjects for a stream.
2022-08-31 16:19:27 -07:00
Ivan Kozlovic
ca54468f3d Merge pull request #3425 from mprimi/js-publish-and-consume-benchmarks
Publish and consume JS benchmarks
2022-08-31 17:12:06 -06:00